aboutsummaryrefslogtreecommitdiff
path: root/test/paths.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-07 22:53:45 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-07 22:53:45 -0500
commit19c8450aa0a9ea008a3e5fd4ec44f7c3761db663 (patch)
tree52295560cc8081d7af0c87b5fbb31bfbaf46a25f /test/paths.tm
parent544b1fb6a70d55bf368b827136cf0f37a26e8288 (diff)
Switch paths to use Result return values instead of fail()
Diffstat (limited to 'test/paths.tm')
-rw-r--r--test/paths.tm10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/paths.tm b/test/paths.tm
index d7630fc3..a0ae4384 100644
--- a/test/paths.tm
+++ b/test/paths.tm
@@ -17,8 +17,8 @@ func main()
assert optional_path == (./foo)
>> tmpfile := (tmpdir++(./one.txt))
- >> tmpfile.write("Hello world")
- >> tmpfile.append("!")
+ >> tmpfile.write("Hello world")!
+ >> tmpfile.append("!")!
assert tmpfile.read() == "Hello world!"
assert tmpfile.read_bytes()! == [0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x21]
assert tmpdir.files().has(tmpfile)
@@ -35,11 +35,11 @@ func main()
else
pass
- >> tmpfile.remove()
+ >> tmpfile.remove()!
assert tmpdir.files().has(tmpfile) == no
- >> tmpdir.remove()
+ >> tmpdir.remove()!
>> p := (/foo/baz.x/qux.tar.gz)
assert p.base_name() == "qux.tar.gz"
@@ -59,12 +59,12 @@ func main()
assert (~/.foo.baz.qux).extension() == "baz.qux"
- assert (/).parent() == (/)
assert (~/x/.).parent() == (~)
assert (~/x).parent() == (~)
assert (.).parent() == (..)
assert (..).parent() == (../..)
assert (../foo).parent() == (..)
+ assert (/).parent() == none
# Concatenation tests:
say("Basic relative path concatenation:")