Merge branch 'jc/ci-upload-artifact-and-linux32'
[git/gitster.git] / t / t0101-at-syntax.sh
blob878aadd64c9517dc1891031bd8bee0b298cfccb6
1 #!/bin/sh
3 test_description='various @{whatever} syntax tests'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success 'setup' '
9 test_commit one &&
10 test_commit two
13 check_at() {
14 echo "$2" >expect &&
15 git log -1 --format=%s "$1" >actual &&
16 test_cmp expect actual
19 test_expect_success '@{0} shows current' '
20 check_at @{0} two
23 test_expect_success '@{1} shows old' '
24 check_at @{1} one
27 test_expect_success '@{now} shows current' '
28 check_at @{now} two
31 test_expect_success '@{2001-09-17} (before the first commit) shows old' '
32 check_at @{2001-09-17} one
35 test_expect_success 'silly approxidates work' '
36 check_at @{3.hot.dogs.on.2001-09-17} one
39 test_expect_success 'notice misspelled upstream' '
40 test_must_fail git log -1 --format=%s @{usptream}
43 test_expect_success 'complain about total nonsense' '
44 test_must_fail git log -1 --format=%s @{utter.bogosity}
47 test_done