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 version/--version equivalence' '
41 stg version > v0.txt &&
42 stg --version > v1.txt &&
44 grep -e "Stacked GIT" v0.txt &&
45 grep -F "$(git --version)" v0.txt &&
46 grep -e "Python version" v0.txt
49 test_expect_success
'Test copyright' '
50 stg copyright | grep -e "This program is free software"