interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t0101-at-syntax.sh

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