File: t0003-id.sh

package info (click to toggle)
stgit 0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,748 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (31 lines) | stat: -rwxr-xr-x 651 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

test_description="Test 'stg id'"
. ./test-lib.sh

test_expect_success 'Test on uninitialized repo' '
    stg id
    '

test_expect_success 'Init repo' '
    echo "foo" > foo.txt &&
    git add foo.txt &&
    git commit -m "initial" &&
    stg init &&
    for i in 1 2; do
      echo "line $i" >> foo.txt &&
      stg new -m "patch-$i" &&
      stg refresh
    done
    '

test_expect_success 'Too many arguments' '
    command_error stg id patch-1 patch-2 2>&1 |
    grep -e "incorrect number of arguments"
    '

test_expect_success 'Provide patch argument' '
    test "$(echo $(stg id))" = "$(echo $(stg id $(stg top)))"
    '

test_done