Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
cf70ea63
Kaydet (Commit)
cf70ea63
authored
Haz 18, 2000
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Additional tests for seek() method, written by Trent Mick
üst
70d2742f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
test_mmap
Lib/test/output/test_mmap
+0
-0
test_mmap.py
Lib/test/test_mmap.py
+36
-1
No files found.
Lib/test/output/test_mmap
Dosyayı görüntüle @
cf70ea63
No preview for this file type
Lib/test/test_mmap.py
Dosyayı görüntüle @
cf70ea63
...
...
@@ -58,7 +58,42 @@ def test_both():
assert
start
==
PAGESIZE
assert
end
==
PAGESIZE
+
6
# test seeking around (try to overflow the seek implementation)
m
.
seek
(
0
,
0
)
print
' Seek to zeroth byte'
assert
m
.
tell
()
==
0
m
.
seek
(
42
,
1
)
print
' Seek to 42nd byte'
assert
m
.
tell
()
==
42
m
.
seek
(
0
,
2
)
print
' Seek to last byte'
assert
m
.
tell
()
==
len
(
m
)
print
' Try to seek to negative position...'
try
:
m
.
seek
(
-
1
)
except
ValueError
:
pass
else
:
assert
0
,
'expected a ValueError but did not get it'
print
' Try to seek beyond end of mmap...'
try
:
m
.
seek
(
1
,
2
)
except
ValueError
:
pass
else
:
assert
0
,
'expected a ValueError but did not get it'
print
' Try to seek to negative position...'
try
:
m
.
seek
(
-
len
(
m
)
-
1
,
2
)
except
ValueError
:
pass
else
:
assert
0
,
'expected a ValueError but did not get it'
m
.
close
()
os
.
unlink
(
"foo"
)
print
' Test passed'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment