diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-12-05 21:52:47 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-12-05 21:52:47 +0100 |
commit | 8feb47e8824e16c0913028a59cfaa6d76fc9f209 (patch) | |
tree | 8112afad8f7b5ec6a0255c264ce3cde9d24100ac /t/t0000-basic.sh | |
parent | Merge branch 'nl/reset-patch-takes-a-tree' (diff) | |
parent | t5520: replace `! git` with `test_must_fail git` (diff) | |
download | git-8feb47e8824e16c0913028a59cfaa6d76fc9f209.tar.xz git-8feb47e8824e16c0913028a59cfaa6d76fc9f209.zip |
Merge branch 'dl/t5520-cleanup'
Test cleanup.
* dl/t5520-cleanup:
t5520: replace `! git` with `test_must_fail git`
t5520: remove redundant lines in test cases
t5520: replace $(cat ...) comparison with test_cmp
t5520: don't put git in upstream of pipe
t5520: test single-line files by git with test_cmp
t5520: use test_cmp_rev where possible
t5520: replace test -{n,z} with test-lib functions
t5520: use test_line_count where possible
t5520: remove spaces after redirect operator
t5520: replace test -f with test-lib functions
t5520: let sed open its own input
t5520: use sq for test case names
t5520: improve test style
t: teach test_cmp_rev to accept ! for not-equals
t0000: test multiple local assignment
Diffstat (limited to 't/t0000-basic.sh')
-rwxr-xr-x | t/t0000-basic.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 7aabde1a69..a5195a8dc4 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -20,9 +20,9 @@ modification *should* take notice and update the test vectors here. . ./test-lib.sh -try_local_x () { - local x="local" && - echo "$x" +try_local_xy () { + local x="local" y="alsolocal" && + echo "$x $y" } # Check whether the shell supports the "local" keyword. "local" is not @@ -35,11 +35,12 @@ try_local_x () { # relying on "local". test_expect_success 'verify that the running shell supports "local"' ' x="notlocal" && - echo "local" >expected1 && - try_local_x >actual1 && + y="alsonotlocal" && + echo "local alsolocal" >expected1 && + try_local_xy >actual1 && test_cmp expected1 actual1 && - echo "notlocal" >expected2 && - echo "$x" >actual2 && + echo "notlocal alsonotlocal" >expected2 && + echo "$x $y" >actual2 && test_cmp expected2 actual2 ' |