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