Mercurial > hg
annotate tests/test-bdiff.py.out @ 30591:1b393a93a7df
tests: migrate test-bdiff.py to use unittest (part 1 of 4)
This moves all the test() calls, which were easy and mechanical.
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 15 Dec 2016 10:10:15 -0500 |
parents | 7c0c722d568d |
children | 0d8cada9998d |
rev | line source |
---|---|
30427
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
1 showdiff( |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
2 'x\n\nx\n\nx\n\nx\n\nz\n', |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
3 'x\n\nx\n\ny\n\nx\n\nx\n\nz\n'): |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
4 'x\n\nx\n\n' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
5 6 6 '' -> 'y\n\n' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
6 'x\n\nx\n\nz\n' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
7 showdiff( |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
8 'x\n\nx\n\nx\n\nx\n\nz\n', |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
9 'x\n\nx\n\ny\n\nx\n\ny\n\nx\n\nz\n'): |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
10 'x\n\nx\n\n' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
11 6 6 '' -> 'y\n\n' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
12 'x\n\n' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
13 9 9 '' -> 'y\n\n' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
14 'x\n\nz\n' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
15 showdiff( |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
16 'a\nb\nb\nb\nc\n.\nd\ne\n.\nf\n', |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
17 'a\nb\nb\na\nb\nb\nb\nc\n.\nb\nc\n.\nd\ne\nf\n'): |
30561
7c0c722d568d
bdiff: early pruning of common prefix before doing expensive computations
Mads Kiilerich <madski@unity3d.com>
parents:
30433
diff
changeset
|
18 'a\nb\nb\n' |
7c0c722d568d
bdiff: early pruning of common prefix before doing expensive computations
Mads Kiilerich <madski@unity3d.com>
parents:
30433
diff
changeset
|
19 6 6 '' -> 'a\nb\nb\nb\nc\n.\n' |
7c0c722d568d
bdiff: early pruning of common prefix before doing expensive computations
Mads Kiilerich <madski@unity3d.com>
parents:
30433
diff
changeset
|
20 'b\nc\n.\nd\ne\n' |
30427
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
21 16 18 '.\n' -> '' |
ede7bc45bf0a
tests: make test-bdiff.py easier to maintain
Mads Kiilerich <madski@unity3d.com>
parents:
29013
diff
changeset
|
22 'f\n' |
400
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
23 done |
15530
eeac5e179243
mdiff: replace wscleanup() regexps with C loops
Patrick Mezard <pmezard@gmail.com>
parents:
8449
diff
changeset
|
24 done |
30431
8c0c75aa3ff4
bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents:
30429
diff
changeset
|
25 Nice diff for a trivial change: |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
26 showdiff( |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
27 '<0\n-\n<1\n-\n<2\n-\n<3\n-\n<4\n-\n', |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
28 '>0\n-\n>1\n-\n>2\n-\n>3\n-\n>4\n-\n'): |
30431
8c0c75aa3ff4
bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents:
30429
diff
changeset
|
29 0 3 '<0\n' -> '>0\n' |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
30 '-\n' |
30431
8c0c75aa3ff4
bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents:
30429
diff
changeset
|
31 5 8 '<1\n' -> '>1\n' |
8c0c75aa3ff4
bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents:
30429
diff
changeset
|
32 '-\n' |
8c0c75aa3ff4
bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents:
30429
diff
changeset
|
33 10 13 '<2\n' -> '>2\n' |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
34 '-\n' |
30431
8c0c75aa3ff4
bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents:
30429
diff
changeset
|
35 15 18 '<3\n' -> '>3\n' |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
36 '-\n' |
30431
8c0c75aa3ff4
bdiff: give slight preference to longest matches in the middle of the B side
Mads Kiilerich <madski@unity3d.com>
parents:
30429
diff
changeset
|
37 20 23 '<4\n' -> '>4\n' |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
38 '-\n' |
30432
3633403888ae
bdiff: give slight preference to appending lines
Mads Kiilerich <madski@unity3d.com>
parents:
30431
diff
changeset
|
39 Diff 1 to 3 lines - preference for appending: |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
40 showdiff( |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
41 'a\n', |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
42 'a\na\na\n'): |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
43 'a\n' |
30432
3633403888ae
bdiff: give slight preference to appending lines
Mads Kiilerich <madski@unity3d.com>
parents:
30431
diff
changeset
|
44 2 2 '' -> 'a\na\n' |
3633403888ae
bdiff: give slight preference to appending lines
Mads Kiilerich <madski@unity3d.com>
parents:
30431
diff
changeset
|
45 Diff 1 to 5 lines - preference for appending: |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
46 showdiff( |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
47 'a\n', |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
48 'a\na\na\na\na\n'): |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
49 'a\n' |
30432
3633403888ae
bdiff: give slight preference to appending lines
Mads Kiilerich <madski@unity3d.com>
parents:
30431
diff
changeset
|
50 2 2 '' -> 'a\na\na\na\n' |
30433
96f2f50d923f
bdiff: give slight preference to removing trailing lines
Mads Kiilerich <madski@unity3d.com>
parents:
30432
diff
changeset
|
51 Diff 3 to 1 lines - preference for removing trailing lines: |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
52 showdiff( |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
53 'a\na\na\n', |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
54 'a\n'): |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
55 'a\n' |
30433
96f2f50d923f
bdiff: give slight preference to removing trailing lines
Mads Kiilerich <madski@unity3d.com>
parents:
30432
diff
changeset
|
56 2 6 'a\na\n' -> '' |
96f2f50d923f
bdiff: give slight preference to removing trailing lines
Mads Kiilerich <madski@unity3d.com>
parents:
30432
diff
changeset
|
57 Diff 5 to 1 lines - preference for removing trailing lines: |
30428
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
58 showdiff( |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
59 'a\na\na\na\na\n', |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
60 'a\n'): |
3743e5dbb824
tests: explore some bdiff cases
Mads Kiilerich <madski@unity3d.com>
parents:
30427
diff
changeset
|
61 'a\n' |
30433
96f2f50d923f
bdiff: give slight preference to removing trailing lines
Mads Kiilerich <madski@unity3d.com>
parents:
30432
diff
changeset
|
62 2 10 'a\na\na\na\n' -> '' |