seed: curriculum content
This commit is contained in:
19
1.solar-system/1.welcome/07.the-editor/testing/test.sh
Normal file
19
1.solar-system/1.welcome/07.the-editor/testing/test.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
bash solution.sh > /dev/null 2>&1
|
||||
|
||||
EXPECTED=$(cat <<'EXP'
|
||||
# Cadet Log — Day 1
|
||||
|
||||
Today I learned to navigate the shell.
|
||||
Tomorrow I will write code.
|
||||
EXP
|
||||
)
|
||||
|
||||
N=0
|
||||
report() { N=$((N+1)); if [ "$1" = "0" ]; then echo "ok $N - $2"; else echo "not ok $N - $2"; fi; }
|
||||
|
||||
[ -f journal.md ]; report $? "journal.md exists"
|
||||
|
||||
ACTUAL=$(cat journal.md 2>/dev/null)
|
||||
ACTUAL="${ACTUAL%$'\n'}"
|
||||
[ "$ACTUAL" = "$EXPECTED" ]; report $? "journal.md matches the template exactly"
|
||||
Reference in New Issue
Block a user