]>
Commit | Line | Data |
---|---|---|
93cfa7c7 JH |
1 | #!/bin/sh |
2 | ||
3 | test_description='various @{whatever} syntax tests' | |
7a98d9ab ÆAB |
4 | |
5 | TEST_PASSES_SANITIZE_LEAK=true | |
93cfa7c7 JH |
6 | . ./test-lib.sh |
7 | ||
8 | test_expect_success 'setup' ' | |
9 | test_commit one && | |
10 | test_commit two | |
11 | ' | |
12 | ||
13 | check_at() { | |
14 | echo "$2" >expect && | |
15 | git log -1 --format=%s "$1" >actual && | |
16 | test_cmp expect actual | |
17 | } | |
18 | ||
19 | test_expect_success '@{0} shows current' ' | |
20 | check_at @{0} two | |
21 | ' | |
22 | ||
23 | test_expect_success '@{1} shows old' ' | |
24 | check_at @{1} one | |
25 | ' | |
26 | ||
27 | test_expect_success '@{now} shows current' ' | |
28 | check_at @{now} two | |
29 | ' | |
30 | ||
6c647af3 JH |
31 | test_expect_success '@{2001-09-17} (before the first commit) shows old' ' |
32 | check_at @{2001-09-17} one | |
93cfa7c7 JH |
33 | ' |
34 | ||
35 | test_expect_success 'silly approxidates work' ' | |
8e52dc30 | 36 | check_at @{3.hot.dogs.on.2001-09-17} one |
93cfa7c7 JH |
37 | ' |
38 | ||
39 | test_expect_success 'notice misspelled upstream' ' | |
40 | test_must_fail git log -1 --format=%s @{usptream} | |
41 | ' | |
42 | ||
43 | test_expect_success 'complain about total nonsense' ' | |
44 | test_must_fail git log -1 --format=%s @{utter.bogosity} | |
45 | ' | |
46 | ||
47 | test_done |