Restore `stg sink --nopush` capability
[stgit.git] / t / t0004-main.sh
blob206a18be572a7f4d78c017d9c8f1caed80eeb78c
1 #!/bin/sh
3 test_description='Test stg.main'
5 . ./test-lib.sh
7 test_expect_success 'Test no command' '
8 general_error stg 2>&1 |
9 grep -e "usage:"
12 test_expect_success 'Test help/--help equivalence' '
13 stg help 2>&1 > h0.txt &&
14 stg --help 2>&1 > h1.txt &&
15 diff h0.txt h1.txt
18 test_expect_success 'Test help on invalid command' '
19 general_error stg help invalidcmd 2>&1 |
20 grep -e "Unknown command: invalidcmd"
23 test_expect_success 'Test help on regular command' '
24 stg help init | grep -e "Usage: stg init"
27 test_expect_success 'Test --help on regular command' '
28 stg --help refresh | grep -e "Usage: stg refresh"
31 test_expect_success 'Test help on alias command' '
32 stg help add | grep -e "Alias for \"git add"
35 test_expect_success 'Test help on ambiguous command' '
36 general_error stg help pu 2>&1 |
37 grep -e "Ambiguous command: pu"
40 test_expect_success 'Test ambiguous alias' '
41 test_config stgit.alias.show-stat "git show --stat" &&
42 stg show-stat &&
43 stg init &&
44 stg show &&
45 general_error stg sho 2>&1 | grep -e "Ambiguous command: sho"
48 test_expect_success 'Test version/--version equivalence' '
49 stg version > v0.txt &&
50 stg --version > v1.txt &&
51 diff v0.txt v1.txt &&
52 grep -e "Stacked Git" v0.txt &&
53 grep -F "$(git --version)" v0.txt &&
54 grep -e "Python 3\." v0.txt
57 test_expect_success 'Test copyright' '
58 stg copyright | grep -e "This program is free software"
61 test_done