3 test_description
='Test stg.main'
7 test_expect_success
'Test no command' '
8 general_error stg 2>&1 |
12 test_expect_success
'Test help/--help equivalence' '
13 stg help 2>&1 > h0.txt &&
14 stg --help 2>&1 > 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" &&
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 &&
52 grep -e "Stacked Git" v0.txt &&
53 grep -F "$(git --version)" v0.txt &&
54 grep -e "Python version" v0.txt
57 test_expect_success
'Test copyright' '
58 stg copyright | grep -e "This program is free software"