haskell: Phase 9 — hk-run-io catches errors and appends to io-lines
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m4s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 04:14:48 +00:00
parent 5f758d27c1
commit 1b844f6a19
3 changed files with 30 additions and 9 deletions

View File

@@ -64,12 +64,11 @@
(hk-test
"readFile error on missing file"
(guard
(e (true (>= (index-of e "file not found") 0)))
(begin
(set! hk-vfs (dict))
(hk-run-io "main = readFile \"no.txt\" >>= putStrLn")
false))
(begin
(set! hk-vfs (dict))
(let
((lines (hk-run-io "main = readFile \"no.txt\" >>= putStrLn")))
(>= (index-of (str lines) "file not found") 0)))
true)
(hk-test