Skip to content

Commit 30d2f5c

Browse files
author
monarch
committed
psuh: add a simple test
Add a test script for the new 'psuh' command. This test ensures the command runs without crashing and produces some expected output, which will help prevent future regressions. It also verifies that the command can correctly read the user.name configuration from the test's sandboxed environment. Signed-off-by: Your Name [email protected]
1 parent 54aeefa commit 30d2f5c

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

t/t9999-psuh-tutorial.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
#!/bin/sh
22

33
test_description='git-psuh test
4-
54
This test runs git-psuh and makes sure it does not crash.'
65

76
. ./test-lib.sh
87

9-
test_expect_success 'git psuh prints a message' '
10-
git psuh >actual &&
11-
test_cmp /dev/null actual
12-
'
13-
14-
test_expect_success 'git psuh does not crash' '
15-
git psuh >actual 2>&1 &&
16-
test $? -eq 0
8+
test_expect_success 'runs correctly with no args and good output' '
9+
git config user.name "Test User" &&
10+
git psuh >actual &&
11+
grep "Your name:" actual
1712
'
1813

19-
test_done
14+
test_done

0 commit comments

Comments
 (0)