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