From 46b0dbc5a448249ddc9a6ce20465f0fa41de6d64 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 11 Jul 2025 16:05:30 -0400 Subject: Use `assert` more in tests to give better error messages --- test/paths.tm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/paths.tm') diff --git a/test/paths.tm b/test/paths.tm index 14a15299..d92d4623 100644 --- a/test/paths.tm +++ b/test/paths.tm @@ -1,9 +1,7 @@ # Tests for file paths func main() - >> (/).exists() - = yes - >> (~/).exists() - = yes + assert (/).exists() + assert (~/).exists() >> (~/Downloads/file(1).txt) = (~/Downloads/file(1).txt) @@ -16,8 +14,7 @@ func main() = (~/example.txt) >> tmpdir := (/tmp/tomo-test-path-XXXXXX).unique_directory() - >> (/tmp).subdirectories().has(tmpdir) - = yes + assert (/tmp).subdirectories().has(tmpdir) >> tmpfile := (tmpdir++(./one.txt)) >> tmpfile.write("Hello world") @@ -26,8 +23,7 @@ func main() = "Hello world!"? >> tmpfile.read_bytes()! = [0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x21] - >> tmpdir.files().has(tmpfile) - = yes + assert tmpdir.files().has(tmpfile) if tmp_lines := tmpfile.by_line() then >> [line for line in tmp_lines] -- cgit v1.2.3