@matheusbsbs / matheus-bagliano / commits / c7053aa88f
Fork 0

tests: Remove heredoc usage inside quotes

The use of heredoc inside quoted strings doesn't seem to be supported by dash. pdksh seems to handle it fine, however. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric Wong committed May 25, 2006 at 19:06 UTC c7053aa88f80e4983ec45fd39a44d146197c21d0
2 files changed +31 -34
t/t2101-update-index-reupdate.sh
+25 -23
@@ -8,15 +8,16 @@ test_description='git-update-index --again test.
8
9 . ./test-lib.sh
10
11 +cat > expected <<\EOF
12 +100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 file1
13 +100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0 file2
14 +EOF
15 test_expect_success 'update-index --add' \
16 'echo hello world >file1 &&
17 echo goodbye people >file2 &&
18 git-update-index --add file1 file2 &&
19 git-ls-files -s >current &&
16 - cmp current - <<\EOF
17 -100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 file1
18 -100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0 file2
19 -EOF'
20 + cmp current expected'
21
22 test_expect_success 'update-index --again' \
23 'rm -f file1 &&
@@ -29,20 +30,22 @@ test_expect_success 'update-index --again' \
30 echo happy - failed as expected
31 fi &&
32 git-ls-files -s >current &&
32 - cmp current - <<\EOF
33 -100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 file1
34 -100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0 file2
35 -EOF'
33 + cmp current expected'
34
35 +cat > expected <<\EOF
36 +100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
37 +EOF
38 test_expect_success 'update-index --remove --again' \
39 'git-update-index --remove --again &&
40 git-ls-files -s >current &&
40 - cmp current - <<\EOF
41 -100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
42 -EOF'
41 + cmp current expected'
42
43 test_expect_success 'first commit' 'git-commit -m initial'
44
45 +cat > expected <<\EOF
46 +100644 53ab446c3f4e42ce9bb728a0ccb283a101be4979 0 dir1/file3
47 +100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
48 +EOF
49 test_expect_success 'update-index again' \
50 'mkdir -p dir1 &&
51 echo hello world >dir1/file3 &&
@@ -52,11 +55,12 @@ test_expect_success 'update-index again' \
55 echo happy >dir1/file3 &&
56 git-update-index --again &&
57 git-ls-files -s >current &&
55 - cmp current - <<\EOF
56 -100644 53ab446c3f4e42ce9bb728a0ccb283a101be4979 0 dir1/file3
57 -100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
58 -EOF'
58 + cmp current expected'
59
60 +cat > expected <<\EOF
61 +100644 d7fb3f695f06c759dbf3ab00046e7cc2da22d10f 0 dir1/file3
62 +100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
63 +EOF
64 test_expect_success 'update-index --update from subdir' \
65 'echo not so happy >file2 &&
66 cd dir1 &&
@@ -64,19 +68,17 @@ test_expect_success 'update-index --update from subdir' \
68 git-update-index --again &&
69 cd .. &&
70 git-ls-files -s >current &&
67 - cmp current - <<\EOF
68 -100644 d7fb3f695f06c759dbf3ab00046e7cc2da22d10f 0 dir1/file3
69 -100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
70 -EOF'
71 + cmp current expected'
72
73 +cat > expected <<\EOF
74 +100644 594fb5bb1759d90998e2bf2a38261ae8e243c760 0 dir1/file3
75 +100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
76 +EOF
77 test_expect_success 'update-index --update with pathspec' \
78 'echo very happy >file2 &&
79 cat file2 >dir1/file3 &&
80 git-update-index --again dir1/ &&
81 git-ls-files -s >current &&
77 - cmp current - <<\EOF
78 -100644 594fb5bb1759d90998e2bf2a38261ae8e243c760 0 dir1/file3
79 -100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
80 -EOF'
82 + cmp current expected'
83
84 test_done
t/t4012-diff-binary.sh
+6 -11
@@ -16,25 +16,20 @@ test_expect_success 'prepare repository' \
16 echo git >c &&
17 cat b b >d'
18
19 -test_expect_success 'diff without --binary' \
20 - 'git-diff | git-apply --stat --summary >current &&
21 - cmp current - <<\EOF
19 +cat > expected <<\EOF
20 a | 2 +-
21 b | Bin
22 c | 2 +-
23 d | Bin
24 4 files changed, 2 insertions(+), 2 deletions(-)
27 -EOF'
25 +EOF
26 +test_expect_success 'diff without --binary' \
27 + 'git-diff | git-apply --stat --summary >current &&
28 + cmp current expected'
29
30 test_expect_success 'diff with --binary' \
31 'git-diff --binary | git-apply --stat --summary >current &&
31 - cmp current - <<\EOF
32 - a | 2 +-
33 - b | Bin
34 - c | 2 +-
35 - d | Bin
36 - 4 files changed, 2 insertions(+), 2 deletions(-)
37 -EOF'
32 + cmp current expected'
33
34 # apply needs to be able to skip the binary material correctly
35 # in order to report the line number of a corrupt patch.