Fossil SCM
Add another merge test case.
Commit
df9880287f0ce7daa4df6132b5b1e7fd00690168
Parent
8b4bcd9d1f21126…
1 file changed
+56
+56
| --- a/test/merge6.test | ||
| +++ b/test/merge6.test | ||
| @@ -0,0 +1,56 @@ | ||
| 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 {wstring map [list \r\_multi-0 {write_file f1 "f1 line" | |
| 29 | +fos} merge_multi-1 {[normalize_result] eq {f1}} | |
| 30 | +string map [list \r\e" "branch for file f2" -b br merge_multi-2 {[normalize_result] eq {f1 | |
| 31 | +f2}} | |
| 32 | + | |
| 33 | +fossil update trunk | |
| 34 | +1 | |
| 35 | +f2} | |
| 36 | + | |
| 37 | +fossil update trunk | |
| 38 | +write_file f3 "f3 line" | |
| 39 | +write_filstring map [list \r\fossil commit -m "branch for files f3 and f4" -b branc merge_multi-3 {[normalize_result] eq {f1 | |
| 40 | +f3 | |
| 41 | +f4}} | |
| 42 | + | |
| 43 | +fossil update trunk | |
| 44 | +fossil merge branch_for_fk | |
| 45 | +fossil merge branch_for_f2 | |
| 46 | +fossil merge branch_for_f3_f4 | |
| 47 | +string map [list \r\_for_f3_f4 | |
| 48 | +fossil commit -m "new merge_multi-4 {[normalize_result] eq {f1 | |
| 49 | +f2 | |
| 50 | +f3 | |
| 51 | +f4}} | |
| 52 | + | |
| 53 | +##########################################################################string map [list \r\n \n] [string trim $RESULT]] eq {f1 | |
| 54 | +f2 | |
| 55 | +f3 | |
| 56 | +f4}} |
| --- a/test/merge6.test | |
| +++ b/test/merge6.test | |
| @@ -0,0 +1,56 @@ | |
| --- a/test/merge6.test | |
| +++ b/test/merge6.test | |
| @@ -0,0 +1,56 @@ | |
| 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 {wstring map [list \r\_multi-0 {write_file f1 "f1 line" |
| 29 | fos} merge_multi-1 {[normalize_result] eq {f1}} |
| 30 | string map [list \r\e" "branch for file f2" -b br merge_multi-2 {[normalize_result] eq {f1 |
| 31 | f2}} |
| 32 | |
| 33 | fossil update trunk |
| 34 | 1 |
| 35 | f2} |
| 36 | |
| 37 | fossil update trunk |
| 38 | write_file f3 "f3 line" |
| 39 | write_filstring map [list \r\fossil commit -m "branch for files f3 and f4" -b branc merge_multi-3 {[normalize_result] eq {f1 |
| 40 | f3 |
| 41 | f4}} |
| 42 | |
| 43 | fossil update trunk |
| 44 | fossil merge branch_for_fk |
| 45 | fossil merge branch_for_f2 |
| 46 | fossil merge branch_for_f3_f4 |
| 47 | string map [list \r\_for_f3_f4 |
| 48 | fossil commit -m "new merge_multi-4 {[normalize_result] eq {f1 |
| 49 | f2 |
| 50 | f3 |
| 51 | f4}} |
| 52 | |
| 53 | ##########################################################################string map [list \r\n \n] [string trim $RESULT]] eq {f1 |
| 54 | f2 |
| 55 | f3 |
| 56 | f4}} |