Elektrine lite

← Feed

@paulshryock@phpc.social

Post #3966331

2026-07-20 18:17 UTC

Here's the whole test runner. It's only 24 lines of Bash. I ended up skipping the "expect" method since it wasn't adding much value. "it" will pass or fail a test based on the most recent exit code. Writing tests is literally this simple: ```bash it "should pass" $(test 1 == 1) it "should fail" $(test 1 == 2) ``` Just run anything after the test description which either exits 0 (pass) or any other number (fail).

Replies (2)

  • @manchuck@phpc.social 2026-07-20 18:23

    @paulshryock@phpc.social YSAP over on YT will be happy. He does a lot of bash programming content @yousuckatprogramming@www.youtube.com

    Open ##3966431

  • @paulshryock@phpc.social 2026-07-20 18:24

    Here's the whole CLI. It's only 18 lines of Bash. As of now, it automatically runs all *.test.sh files found in the ./tests/ directory, but in the future I'll probably add a way to specify one or more files or test suites.

    Open ##3966437