aboutsummaryrefslogtreecommitdiff
path: root/test/paths.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-07-11 16:05:30 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-07-11 16:05:30 -0400
commit46b0dbc5a448249ddc9a6ce20465f0fa41de6d64 (patch)
treea353513c1fdb95baa2d225fa50972be3c9d11d4e /test/paths.tm
parent4834f3355d3b0355cb6ff7774d18e86ca0f5e38e (diff)
Use `assert` more in tests to give better error messages
Diffstat (limited to 'test/paths.tm')
-rw-r--r--test/paths.tm12
1 files changed, 4 insertions, 8 deletions
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]