commit e7bfdf1212aec7adf082f60fef7a958be39756a0 parent e0a9d08d93752567de82756dd5ac3f994436c76d Author: Henry Unite <unitehenry@gmail.com> Date: Sun, 12 Apr 2026 22:20:44 +0000 test: assert ssg Diffstat:
| A | scripts/test | | | 19 | +++++++++++++++++++ |
| A | test/index.md | | | 3 | +++ |
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/scripts/test b/scripts/test @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +gcc src/*.c -o site + +if [ $? -eq 0 ]; then + chmod +x site + + ./site test +fi + +assert() { + if [[ "$3" != $(cat $1 | htmlq $2 --text) ]]; then + echo "Failed to assert '$2'" + exit 1 + fi +} + +assert build/index.html '#static-site-generator' 'Static Site Generator' +assert build/index.html '#static-site-generator + p' 'A static site generator written in C.' diff --git a/test/index.md b/test/index.md @@ -0,0 +1,3 @@ +# Static Site Generator + +A static site generator written in C.