seed: curriculum content
This commit is contained in:
16
1.solar-system/1.welcome/02.hello-world/testing/test.sh
Normal file
16
1.solar-system/1.welcome/02.hello-world/testing/test.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
bash solution.sh > /dev/null 2>&1
|
||||
|
||||
if [ -f hello.txt ]; then
|
||||
echo "ok 1 - hello.txt is created"
|
||||
else
|
||||
echo "not ok 1 - hello.txt is created"
|
||||
fi
|
||||
|
||||
ACTUAL=$(cat hello.txt 2>/dev/null)
|
||||
ACTUAL="${ACTUAL%$'\n'}"
|
||||
if [ "$ACTUAL" = "Hello, World" ]; then
|
||||
echo "ok 2 - hello.txt contains 'Hello, World'"
|
||||
else
|
||||
echo "not ok 2 - hello.txt contains 'Hello, World'"
|
||||
fi
|
||||
Reference in New Issue
Block a user