Fossil SCM
Add another merge test case.
Commit
df9880287f0ce7daa4df6132b5b1e7fd00690168
Parent
8b4bcd9d1f21126…
1 file changed
+59
+59
| --- a/test/merge6.test | ||
| +++ b/test/merge6.test | ||
| @@ -0,0 +1,59 @@ | ||
| 1 | +# | |
| 2 | +# Copyright (c) 2014 D. Richard Hipp | |
| 3 | +# | |
| 4 | +# This program is free software; you can redistribute it and/or | |
| 5 | +# modify it under the terms of the Simplified BSD License (also | |
| 6 | +# known as the "2-Clause License" or "FreeBSD License".) | |
| 7 | +# | |
| 8 | +# This program is distributed in the hope that it will be useful, | |
| 9 | +# but without any warranty; without even the implied warranty of | |
| 10 | +# merchantability or fitness for a particular purpose. | |
| 11 | +# | |
| 12 | +# Author contact information: | |
| 13 | +# [email protected] | |
| 14 | +# http://www.hwaci.com/drh/ | |
| 15 | +# | |
| 16 | +############################################################################ | |
| 17 | +# | |
| 18 | +# Tests of the "merge" command | |
| 19 | +# | |
| 20 | + | |
| 21 | +#################################################################### | |
| 22 | +# TEST 1: Handle multiple merges each with one or more ADDED files # | |
| 23 | +###########################################repo_init############### | |
| 24 | + | |
| 25 | +test_setup | |
| 26 | +fossil ls | |
| 27 | + | |
| 28 | +test merge_multi-0 {[string map [list \r\_multi-0 {[normalize_result] eq {}} | |
| 29 | + | |
| 30 | +write_file f1 "f1 line" | |
| 31 | +fossil add f1 | |
| 32 | +fossil string map [list \r\_multi-1 {[normalize_result] eq {f1}} | |
| 33 | + | |
| 34 | +fossil update trunk | |
| 35 | +write_file f2 "f2 line" | |
| 36 | +fossil add f2 | |
| 37 | +fossil commit -m "branch for file f2" -b branch_for_f2 | |
| 38 | +fossistring map [list \r\] eq {f1 | |
| 39 | +f2}} | |
| 40 | + | |
| 41 | +fossil update trunk | |
| 42 | +write_file f3 "f3 line" | |
| 43 | +write_file f4 "f4 line" | |
| 44 | +fossil add f3 | |
| 45 | +fossil add f4 | |
| 46 | +fossil commit -m "branch for files f3 and f4" -b branch_for_f3_f4 | |
| 47 | +fossil ls | |
| 48 | + | |
| 49 | +test merge_multi-3 {[string map [list \r\_multi-3 {[normalize_result] eq {f1 | |
| 50 | +f3 | |
| 51 | +f4}} | |
| 52 | + | |
| 53 | +fossil update trunk | |
| 54 | +fossil merge branch_for_f2 | |
| 55 | +fossil merge branch_for_f3_f4 | |
| 56 | +fossil commit -m "new trunk files f2, string map [list \r\n \n] [string trim $RESULT]] eq {f1 | |
| 57 | +f2 | |
| 58 | +f3 | |
| 59 | +f4}} |
| --- a/test/merge6.test | |
| +++ b/test/merge6.test | |
| @@ -0,0 +1,59 @@ | |
| --- a/test/merge6.test | |
| +++ b/test/merge6.test | |
| @@ -0,0 +1,59 @@ | |
| 1 | # |
| 2 | # Copyright (c) 2014 D. Richard Hipp |
| 3 | # |
| 4 | # This program is free software; you can redistribute it and/or |
| 5 | # modify it under the terms of the Simplified BSD License (also |
| 6 | # known as the "2-Clause License" or "FreeBSD License".) |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, |
| 9 | # but without any warranty; without even the implied warranty of |
| 10 | # merchantability or fitness for a particular purpose. |
| 11 | # |
| 12 | # Author contact information: |
| 13 | # [email protected] |
| 14 | # http://www.hwaci.com/drh/ |
| 15 | # |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # Tests of the "merge" command |
| 19 | # |
| 20 | |
| 21 | #################################################################### |
| 22 | # TEST 1: Handle multiple merges each with one or more ADDED files # |
| 23 | ###########################################repo_init############### |
| 24 | |
| 25 | test_setup |
| 26 | fossil ls |
| 27 | |
| 28 | test merge_multi-0 {[string map [list \r\_multi-0 {[normalize_result] eq {}} |
| 29 | |
| 30 | write_file f1 "f1 line" |
| 31 | fossil add f1 |
| 32 | fossil string map [list \r\_multi-1 {[normalize_result] eq {f1}} |
| 33 | |
| 34 | fossil update trunk |
| 35 | write_file f2 "f2 line" |
| 36 | fossil add f2 |
| 37 | fossil commit -m "branch for file f2" -b branch_for_f2 |
| 38 | fossistring map [list \r\] eq {f1 |
| 39 | f2}} |
| 40 | |
| 41 | fossil update trunk |
| 42 | write_file f3 "f3 line" |
| 43 | write_file f4 "f4 line" |
| 44 | fossil add f3 |
| 45 | fossil add f4 |
| 46 | fossil commit -m "branch for files f3 and f4" -b branch_for_f3_f4 |
| 47 | fossil ls |
| 48 | |
| 49 | test merge_multi-3 {[string map [list \r\_multi-3 {[normalize_result] eq {f1 |
| 50 | f3 |
| 51 | f4}} |
| 52 | |
| 53 | fossil update trunk |
| 54 | fossil merge branch_for_f2 |
| 55 | fossil merge branch_for_f3_f4 |
| 56 | fossil commit -m "new trunk files f2, string map [list \r\n \n] [string trim $RESULT]] eq {f1 |
| 57 | f2 |
| 58 | f3 |
| 59 | f4}} |