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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#!/bin/sh
test_description='Test stg.main'
. ./test-lib.sh
test_expect_success 'Test no command' '
general_error stg 2>&1 |
grep -e "usage:"
'
test_expect_success 'Test help/--help equivalence' '
stg help 2>&1 > h0.txt &&
stg --help 2>&1 > h1.txt &&
diff h0.txt h1.txt
'
test_expect_success 'Test help on invalid command' '
general_error stg help invalidcmd 2>&1 |
grep -e "Unknown command: invalidcmd"
'
test_expect_success 'Test help on regular command' '
stg help init | grep -e "Usage: stg init"
'
test_expect_success 'Test --help on regular command' '
stg --help refresh | grep -e "Usage: stg refresh"
'
test_expect_success 'Test help on alias command' '
stg help add | grep -e "Alias for \"git add"
'
test_expect_success 'Test help on ambiguous command' '
general_error stg help pu 2>&1 |
grep -e "Ambiguous command: pu"
'
test_expect_success 'Test version/--version equivalence' '
stg version > v0.txt &&
stg --version > v1.txt &&
diff v0.txt v1.txt &&
grep -e "Stacked GIT" v0.txt &&
grep -F "$(git --version)" v0.txt &&
grep -e "Python version" v0.txt
'
test_expect_success 'Test copyright' '
stg copyright | grep -e "This program is free software"
'
test_done
|