Fossil SCM
Have all appropriate tests use 'normalize_result' instead of a raw 'string map'.
Commit
d2cf0713ef8ee45749bf4de78c5a50b21cf69c7c
Parent
cdd2ede6a20464a…
4 files changed
+5
-5
+1
-1
+2
-4
+4
-4
+5
-5
| --- test/merge6.test | ||
| +++ test/merge6.test | ||
| @@ -23,26 +23,26 @@ | ||
| 23 | 23 | #################################################################### |
| 24 | 24 | |
| 25 | 25 | repo_init |
| 26 | 26 | fossil ls |
| 27 | 27 | |
| 28 | -test merge_multi-0 {[string map [list \r\n \n] [string trim $RESULT]] eq {}} | |
| 28 | +test merge_multi-0 {[normalize_result] eq {}} | |
| 29 | 29 | |
| 30 | 30 | write_file f1 "f1 line" |
| 31 | 31 | fossil add f1 |
| 32 | 32 | fossil commit -m "base file" |
| 33 | 33 | fossil ls |
| 34 | 34 | |
| 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}} | |
| 36 | 36 | |
| 37 | 37 | fossil update trunk |
| 38 | 38 | write_file f2 "f2 line" |
| 39 | 39 | fossil add f2 |
| 40 | 40 | fossil commit -m "branch for file f2" -b branch_for_f2 |
| 41 | 41 | fossil ls |
| 42 | 42 | |
| 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 | |
| 44 | 44 | f2}} |
| 45 | 45 | |
| 46 | 46 | fossil update trunk |
| 47 | 47 | write_file f3 "f3 line" |
| 48 | 48 | write_file f4 "f4 line" |
| @@ -49,19 +49,19 @@ | ||
| 49 | 49 | fossil add f3 |
| 50 | 50 | fossil add f4 |
| 51 | 51 | fossil commit -m "branch for files f3 and f4" -b branch_for_f3_f4 |
| 52 | 52 | fossil ls |
| 53 | 53 | |
| 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 | |
| 55 | 55 | f3 |
| 56 | 56 | f4}} |
| 57 | 57 | |
| 58 | 58 | fossil update trunk |
| 59 | 59 | fossil merge branch_for_f2 |
| 60 | 60 | fossil merge branch_for_f3_f4 |
| 61 | 61 | fossil commit -m "new trunk files f2, f3, and f4 via merge" |
| 62 | 62 | fossil ls |
| 63 | 63 | |
| 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 | |
| 65 | 65 | f2 |
| 66 | 66 | f3 |
| 67 | 67 | f4}} |
| 68 | 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 {[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 |
+1
-1
| --- test/merge_renames.test | ||
| +++ test/merge_renames.test | ||
| @@ -197,11 +197,11 @@ | ||
| 197 | 197 | fossil merge trunk |
| 198 | 198 | fossil commit -m "trunk merged, should have 3 files" |
| 199 | 199 | |
| 200 | 200 | fossil ls |
| 201 | 201 | |
| 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 | |
| 203 | 203 | f2 |
| 204 | 204 | f3}} |
| 205 | 205 | |
| 206 | 206 | ###################################### |
| 207 | 207 | # |
| 208 | 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 {[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 |
+2
-4
| --- test/th1-tcl.test | ||
| +++ test/th1-tcl.test | ||
| @@ -54,20 +54,18 @@ | ||
| 54 | 54 | \d+ |
| 55 | 55 | two words |
| 56 | 56 | 4 |
| 57 | 57 | \d+ |
| 58 | 58 | one_word |
| 59 | -three words now | |
| 60 | -$} [string map [list \r\n \n] $RESULT]]} | |
| 59 | +three words now$} [normalize_result]]} | |
| 61 | 60 | |
| 62 | 61 | ############################################################################### |
| 63 | 62 | |
| 64 | 63 | fossil test-th-render --open-config \ |
| 65 | 64 | [file nativename [file join $dir th1-tcl2.txt]] |
| 66 | 65 | |
| 67 | -test th1-tcl-2 {[regexp -- {^\d+ | |
| 68 | -$} [string map [list \r\n \n] $RESULT]]} | |
| 66 | +test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]} | |
| 69 | 67 | |
| 70 | 68 | ############################################################################### |
| 71 | 69 | |
| 72 | 70 | fossil test-th-render --open-config \ |
| 73 | 71 | [file nativename [file join $dir th1-tcl3.txt]] |
| 74 | 72 |
| --- 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 @@ | ||
| 591 | 591 | |
| 592 | 592 | ############################################################################### |
| 593 | 593 | |
| 594 | 594 | fossil test-th-eval --th-trace "trace {}" |
| 595 | 595 | 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 \ | |
| 597 | 597 | {------------------ BEGIN TRACE LOG ------------------ |
| 598 | 598 | th1-init 0x0 => 0x0<br /> |
| 599 | 599 | |
| 600 | 600 | ------------------- END TRACE LOG -------------------}} |
| 601 | 601 | } else { |
| 602 | - test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ | |
| 602 | + test th1-trace-2 {[normalize_result] eq \ | |
| 603 | 603 | {------------------ BEGIN TRACE LOG ------------------ |
| 604 | 604 | th1-init 0x0 => 0x0<br /> |
| 605 | 605 | th1-setup {} => TH_OK<br /> |
| 606 | 606 | |
| 607 | 607 | ------------------- END TRACE LOG -------------------}} |
| @@ -614,17 +614,17 @@ | ||
| 614 | 614 | |
| 615 | 615 | ############################################################################### |
| 616 | 616 | |
| 617 | 617 | fossil test-th-eval --th-trace "trace {this is a trace message.}" |
| 618 | 618 | 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 \ | |
| 620 | 620 | {------------------ BEGIN TRACE LOG ------------------ |
| 621 | 621 | th1-init 0x0 => 0x0<br /> |
| 622 | 622 | this is a trace message. |
| 623 | 623 | ------------------- END TRACE LOG -------------------}} |
| 624 | 624 | } else { |
| 625 | - test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ | |
| 625 | + test th1-trace-4 {[normalize_result] eq \ | |
| 626 | 626 | {------------------ BEGIN TRACE LOG ------------------ |
| 627 | 627 | th1-init 0x0 => 0x0<br /> |
| 628 | 628 | th1-setup {} => TH_OK<br /> |
| 629 | 629 | this is a trace message. |
| 630 | 630 | ------------------- END TRACE LOG -------------------}} |
| 631 | 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 {[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 |