File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ library diff3_dig_test;
2+
3+ import "package:unittest/unittest.dart" ;
4+
5+ import "package:diff/diff.dart" ;
6+
7+ void defineTests () {
8+ group ('diff3_dig' , () {
9+ test ('multiline difference' , () {
10+ // base
11+ String o = "AA ZZ 00 M 99" .split (" " ).join ("\n " );
12+
13+ // ours
14+ String a = "AA a b c ZZ new 00 a a M 99" .split (" " ).join ("\n " );
15+
16+ // theirs
17+ String b = "AA a d c ZZ 11 M z z 99" .split (" " ).join ("\n " );
18+
19+ Diff3DigResult diff3DigResult = diff3_dig (a, o, b);
20+
21+ expect (diff3DigResult, isNotNull);
22+ String expectResultText = """AA
23+ a
24+ <<<<<<<<<
25+ b
26+ =========
27+ d
28+ >>>>>>>>>
29+ c
30+ ZZ
31+ <<<<<<<<<
32+ new
33+ 00
34+ a
35+ a
36+ =========
37+ 11
38+ >>>>>>>>>
39+ M
40+ z
41+ z
42+ 99""" ;
43+ String actualResultText = diff3DigResult.Text .join ("\n " );
44+ expect (actualResultText, equals (expectResultText));
45+ });
46+ });
47+
48+ }
49+
50+ void main () {
51+ defineTests ();
52+ }
Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ library test_runner;
22
33import "src/side_enum_test.dart" as side_enum_test;
44import "src/diff3_set_test.dart" as diff3_set_test;
5+ import "src/diff3_dig_test.dart" as diff3_dig_test;
56
67void main () {
78 side_enum_test.main ();
89 diff3_set_test.main ();
10+ diff3_dig_test.main ();
911}
You can’t perform that action at this time.
0 commit comments