makefile: Include import-commit in list of scripts
[guilt.git] / regression / 025-new.sh
blob92552ed27697d90982de30f016891e675e002a34
2 # Test the new code
5 source scaffold
6 source generic_test_data
8 function expected_files
10 cat << DONE
11 d .git/patches
12 d .git/patches/master
13 f .git/patches/master/series
14 f .git/patches/master/status
15 f .git/patches/master/modify
16 f .git/patches/master/add
17 f .git/patches/master/remove
18 f .git/patches/master/mode
19 DONE
22 function patch_name_dir
24 echo "aaa"
26 function expected_files_dir
28 expected_files
29 cat << DONE
30 f .git/patches/master/aaa
31 DONE
34 function patch_name_subdir
36 echo "abc/def"
38 function expected_files_subdir
40 expected_files_dir
41 cat << DONE
42 d .git/patches/master/abc
43 f .git/patches/master/abc/def
44 DONE
47 function patch_name_subsubdir
49 echo "foo/bar/patch"
51 function expected_files_subsubdir
53 expected_files_subdir
54 cat << DONE
55 d .git/patches/master/foo
56 d .git/patches/master/foo/bar
57 f .git/patches/master/foo/bar/patch
58 DONE
61 function expected_files_append
63 expected_files_subsubdir
64 echo "f .git/patches/master/append"
67 function expected_files_prepend
69 expected_files_append
70 echo "f .git/patches/master/prepend"
73 # the test itself
74 empty_repo
75 cd $REPODIR
76 guilt-init
78 generic_prepare_for_tests
80 tests="dir subdir subsubdir"
82 for t in $tests; do
83 guilt-new `patch_name_$t`
85 expected_files_$t | verify_repo .git/patches
87 echo -n "[$t] "
88 done
90 guilt-push --all > /dev/null
92 guilt-new append
93 expected_files_append | verify_repo .git/patches
94 echo -n "[append] "
96 guilt-pop -a > /dev/null
98 guilt-new prepend
99 expected_files_prepend | verify_repo .git/patches
100 echo -n "[prepend] "
102 complete_test