Fossil SCM

Have all appropriate tests use 'normalize_result' instead of a raw 'string map'.

mistachkin 2015-05-27 18:37 mvRmHardFix
Commit d2cf0713ef8ee45749bf4de78c5a50b21cf69c7c
--- test/merge6.test
+++ test/merge6.test
@@ -23,26 +23,26 @@
2323
####################################################################
2424
2525
repo_init
2626
fossil ls
2727
28
-test merge_multi-0 {[string map [list \r\n \n] [string trim $RESULT]] eq {}}
28
+test merge_multi-0 {[normalize_result] eq {}}
2929
3030
write_file f1 "f1 line"
3131
fossil add f1
3232
fossil commit -m "base file"
3333
fossil ls
3434
35
-test merge_multi-1 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1}}
35
+test merge_multi-1 {[normalize_result] eq {f1}}
3636
3737
fossil update trunk
3838
write_file f2 "f2 line"
3939
fossil add f2
4040
fossil commit -m "branch for file f2" -b branch_for_f2
4141
fossil ls
4242
43
-test merge_multi-2 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1
43
+test merge_multi-2 {[normalize_result] eq {f1
4444
f2}}
4545
4646
fossil update trunk
4747
write_file f3 "f3 line"
4848
write_file f4 "f4 line"
@@ -49,19 +49,19 @@
4949
fossil add f3
5050
fossil add f4
5151
fossil commit -m "branch for files f3 and f4" -b branch_for_f3_f4
5252
fossil ls
5353
54
-test merge_multi-3 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1
54
+test merge_multi-3 {[normalize_result] eq {f1
5555
f3
5656
f4}}
5757
5858
fossil update trunk
5959
fossil merge branch_for_f2
6060
fossil merge branch_for_f3_f4
6161
fossil commit -m "new trunk files f2, f3, and f4 via merge"
6262
fossil ls
6363
64
-test merge_multi-4 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1
64
+test merge_multi-4 {[normalize_result] eq {f1
6565
f2
6666
f3
6767
f4}}
6868
--- test/merge6.test
+++ test/merge6.test
@@ -23,26 +23,26 @@
23 ####################################################################
24
25 repo_init
26 fossil ls
27
28 test merge_multi-0 {[string map [list \r\n \n] [string trim $RESULT]] eq {}}
29
30 write_file f1 "f1 line"
31 fossil add f1
32 fossil commit -m "base file"
33 fossil ls
34
35 test merge_multi-1 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1}}
36
37 fossil update trunk
38 write_file f2 "f2 line"
39 fossil add f2
40 fossil commit -m "branch for file f2" -b branch_for_f2
41 fossil ls
42
43 test merge_multi-2 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1
44 f2}}
45
46 fossil update trunk
47 write_file f3 "f3 line"
48 write_file f4 "f4 line"
@@ -49,19 +49,19 @@
49 fossil add f3
50 fossil add f4
51 fossil commit -m "branch for files f3 and f4" -b branch_for_f3_f4
52 fossil ls
53
54 test merge_multi-3 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1
55 f3
56 f4}}
57
58 fossil update trunk
59 fossil merge branch_for_f2
60 fossil merge branch_for_f3_f4
61 fossil commit -m "new trunk files f2, f3, and f4 via merge"
62 fossil ls
63
64 test merge_multi-4 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1
65 f2
66 f3
67 f4}}
68
--- test/merge6.test
+++ test/merge6.test
@@ -23,26 +23,26 @@
23 ####################################################################
24
25 repo_init
26 fossil ls
27
28 test merge_multi-0 {[normalize_result] eq {}}
29
30 write_file f1 "f1 line"
31 fossil add f1
32 fossil commit -m "base file"
33 fossil ls
34
35 test merge_multi-1 {[normalize_result] eq {f1}}
36
37 fossil update trunk
38 write_file f2 "f2 line"
39 fossil add f2
40 fossil commit -m "branch for file f2" -b branch_for_f2
41 fossil ls
42
43 test merge_multi-2 {[normalize_result] eq {f1
44 f2}}
45
46 fossil update trunk
47 write_file f3 "f3 line"
48 write_file f4 "f4 line"
@@ -49,19 +49,19 @@
49 fossil add f3
50 fossil add f4
51 fossil commit -m "branch for files f3 and f4" -b branch_for_f3_f4
52 fossil ls
53
54 test merge_multi-3 {[normalize_result] eq {f1
55 f3
56 f4}}
57
58 fossil update trunk
59 fossil merge branch_for_f2
60 fossil merge branch_for_f3_f4
61 fossil commit -m "new trunk files f2, f3, and f4 via merge"
62 fossil ls
63
64 test merge_multi-4 {[normalize_result] eq {f1
65 f2
66 f3
67 f4}}
68
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -197,11 +197,11 @@
197197
fossil merge trunk
198198
fossil commit -m "trunk merged, should have 3 files"
199199
200200
fossil ls
201201
202
-test merge_renames-5 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1
202
+test merge_renames-5 {[normalize_result] eq {f1
203203
f2
204204
f3}}
205205
206206
######################################
207207
#
208208
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -197,11 +197,11 @@
197 fossil merge trunk
198 fossil commit -m "trunk merged, should have 3 files"
199
200 fossil ls
201
202 test merge_renames-5 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1
203 f2
204 f3}}
205
206 ######################################
207 #
208
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -197,11 +197,11 @@
197 fossil merge trunk
198 fossil commit -m "trunk merged, should have 3 files"
199
200 fossil ls
201
202 test merge_renames-5 {[normalize_result] eq {f1
203 f2
204 f3}}
205
206 ######################################
207 #
208
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -54,20 +54,18 @@
5454
\d+
5555
two words
5656
4
5757
\d+
5858
one_word
59
-three words now
60
-$} [string map [list \r\n \n] $RESULT]]}
59
+three words now$} [normalize_result]]}
6160
6261
###############################################################################
6362
6463
fossil test-th-render --open-config \
6564
[file nativename [file join $dir th1-tcl2.txt]]
6665
67
-test th1-tcl-2 {[regexp -- {^\d+
68
-$} [string map [list \r\n \n] $RESULT]]}
66
+test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
6967
7068
###############################################################################
7169
7270
fossil test-th-render --open-config \
7371
[file nativename [file join $dir th1-tcl3.txt]]
7472
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -54,20 +54,18 @@
54 \d+
55 two words
56 4
57 \d+
58 one_word
59 three words now
60 $} [string map [list \r\n \n] $RESULT]]}
61
62 ###############################################################################
63
64 fossil test-th-render --open-config \
65 [file nativename [file join $dir th1-tcl2.txt]]
66
67 test th1-tcl-2 {[regexp -- {^\d+
68 $} [string map [list \r\n \n] $RESULT]]}
69
70 ###############################################################################
71
72 fossil test-th-render --open-config \
73 [file nativename [file join $dir th1-tcl3.txt]]
74
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -54,20 +54,18 @@
54 \d+
55 two words
56 4
57 \d+
58 one_word
59 three words now$} [normalize_result]]}
 
60
61 ###############################################################################
62
63 fossil test-th-render --open-config \
64 [file nativename [file join $dir th1-tcl2.txt]]
65
66 test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
 
67
68 ###############################################################################
69
70 fossil test-th-render --open-config \
71 [file nativename [file join $dir th1-tcl3.txt]]
72
+4 -4
--- test/th1.test
+++ test/th1.test
@@ -591,17 +591,17 @@
591591
592592
###############################################################################
593593
594594
fossil test-th-eval --th-trace "trace {}"
595595
if {$th1Hooks} {
596
- test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \
596
+ test th1-trace-2 {[normalize_result] eq \
597597
{------------------ BEGIN TRACE LOG ------------------
598598
th1-init 0x0 => 0x0<br />
599599
600600
------------------- END TRACE LOG -------------------}}
601601
} else {
602
- test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \
602
+ test th1-trace-2 {[normalize_result] eq \
603603
{------------------ BEGIN TRACE LOG ------------------
604604
th1-init 0x0 => 0x0<br />
605605
th1-setup {} => TH_OK<br />
606606
607607
------------------- END TRACE LOG -------------------}}
@@ -614,17 +614,17 @@
614614
615615
###############################################################################
616616
617617
fossil test-th-eval --th-trace "trace {this is a trace message.}"
618618
if {$th1Hooks} {
619
- test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \
619
+ test th1-trace-4 {[normalize_result] eq \
620620
{------------------ BEGIN TRACE LOG ------------------
621621
th1-init 0x0 => 0x0<br />
622622
this is a trace message.
623623
------------------- END TRACE LOG -------------------}}
624624
} else {
625
- test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \
625
+ test th1-trace-4 {[normalize_result] eq \
626626
{------------------ BEGIN TRACE LOG ------------------
627627
th1-init 0x0 => 0x0<br />
628628
th1-setup {} => TH_OK<br />
629629
this is a trace message.
630630
------------------- END TRACE LOG -------------------}}
631631
--- test/th1.test
+++ test/th1.test
@@ -591,17 +591,17 @@
591
592 ###############################################################################
593
594 fossil test-th-eval --th-trace "trace {}"
595 if {$th1Hooks} {
596 test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \
597 {------------------ BEGIN TRACE LOG ------------------
598 th1-init 0x0 => 0x0<br />
599
600 ------------------- END TRACE LOG -------------------}}
601 } else {
602 test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \
603 {------------------ BEGIN TRACE LOG ------------------
604 th1-init 0x0 => 0x0<br />
605 th1-setup {} => TH_OK<br />
606
607 ------------------- END TRACE LOG -------------------}}
@@ -614,17 +614,17 @@
614
615 ###############################################################################
616
617 fossil test-th-eval --th-trace "trace {this is a trace message.}"
618 if {$th1Hooks} {
619 test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \
620 {------------------ BEGIN TRACE LOG ------------------
621 th1-init 0x0 => 0x0<br />
622 this is a trace message.
623 ------------------- END TRACE LOG -------------------}}
624 } else {
625 test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \
626 {------------------ BEGIN TRACE LOG ------------------
627 th1-init 0x0 => 0x0<br />
628 th1-setup {} => TH_OK<br />
629 this is a trace message.
630 ------------------- END TRACE LOG -------------------}}
631
--- test/th1.test
+++ test/th1.test
@@ -591,17 +591,17 @@
591
592 ###############################################################################
593
594 fossil test-th-eval --th-trace "trace {}"
595 if {$th1Hooks} {
596 test th1-trace-2 {[normalize_result] eq \
597 {------------------ BEGIN TRACE LOG ------------------
598 th1-init 0x0 => 0x0<br />
599
600 ------------------- END TRACE LOG -------------------}}
601 } else {
602 test th1-trace-2 {[normalize_result] eq \
603 {------------------ BEGIN TRACE LOG ------------------
604 th1-init 0x0 => 0x0<br />
605 th1-setup {} => TH_OK<br />
606
607 ------------------- END TRACE LOG -------------------}}
@@ -614,17 +614,17 @@
614
615 ###############################################################################
616
617 fossil test-th-eval --th-trace "trace {this is a trace message.}"
618 if {$th1Hooks} {
619 test th1-trace-4 {[normalize_result] eq \
620 {------------------ BEGIN TRACE LOG ------------------
621 th1-init 0x0 => 0x0<br />
622 this is a trace message.
623 ------------------- END TRACE LOG -------------------}}
624 } else {
625 test th1-trace-4 {[normalize_result] eq \
626 {------------------ BEGIN TRACE LOG ------------------
627 th1-init 0x0 => 0x0<br />
628 th1-setup {} => TH_OK<br />
629 this is a trace message.
630 ------------------- END TRACE LOG -------------------}}
631

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button