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
cf691935
Kaydet (Commit)
cf691935
authored
Eyl 21, 2001
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reportdiff(): print a "plain diff" style diff.
XXX This should really be a unified diff, but I can't be bothered.
üst
0a076397
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
regrtest.py
Lib/test/regrtest.py
+30
-4
No files found.
Lib/test/regrtest.py
Dosyayı görüntüle @
cf691935
...
...
@@ -351,10 +351,36 @@ def runtest(test, generate, verbose, quiet, testdir = None):
def
reportdiff
(
expected
,
output
):
print
"*"
*
70
import
difflib
a
=
expected
.
splitlines
(
1
)
b
=
output
.
splitlines
(
1
)
diff
=
difflib
.
ndiff
(
a
,
b
)
print
''
.
join
(
diff
),
a
=
expected
.
splitlines
()
b
=
output
.
splitlines
()
sm
=
difflib
.
SequenceMatcher
(
a
=
a
,
b
=
b
)
tuples
=
sm
.
get_opcodes
()
def
pair
(
x0
,
x1
):
x0
+=
1
if
x0
>=
x1
:
return
str
(
x0
)
else
:
return
"
%
d,
%
d"
%
(
x0
,
x1
)
for
op
,
a0
,
a1
,
b0
,
b1
in
tuples
:
if
op
==
'equal'
:
pass
elif
op
==
'delete'
:
print
pair
(
a0
,
a1
)
+
"d"
+
pair
(
b0
,
b1
)
for
line
in
a
[
a0
:
a1
]:
print
"<"
,
line
elif
op
==
'replace'
:
print
pair
(
a0
,
a1
)
+
"c"
+
pair
(
b0
,
b1
)
for
line
in
a
[
a0
:
a1
]:
print
"<"
,
line
print
"---"
for
line
in
b
[
b0
:
b1
]:
print
">"
,
line
elif
op
==
'insert'
:
print
str
(
a0
)
+
"a"
+
pair
(
b0
,
b1
)
for
line
in
b
[
b0
:
b1
]:
print
">"
,
line
else
:
print
"get_opcodes() returned bad tuple?!?!"
,
(
op
,
a0
,
a1
,
b0
,
b1
)
print
"*"
*
70
def
findtestdir
():
...
...
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