diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-12-07 22:53:45 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-12-07 22:53:45 -0500 |
| commit | 19c8450aa0a9ea008a3e5fd4ec44f7c3761db663 (patch) | |
| tree | 52295560cc8081d7af0c87b5fbb31bfbaf46a25f /test | |
| parent | 544b1fb6a70d55bf368b827136cf0f37a26e8288 (diff) | |
Switch paths to use Result return values instead of fail()
Diffstat (limited to 'test')
| -rw-r--r-- | test/paths.tm | 10 |
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:") |
