aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/paths.tm26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/paths.tm b/test/paths.tm
new file mode 100644
index 00000000..bc85c31a
--- /dev/null
+++ b/test/paths.tm
@@ -0,0 +1,26 @@
+# Tests for file paths
+func main():
+ >> (/):exists()
+ = yes
+ >> (~/):exists()
+ = yes
+
+ >> tmpdir := (/tmp/tomo-test-path-XXXXXX):unique_directory()
+ >> (/tmp):subdirectories():has(tmpdir)
+ = yes
+
+ >> tmpfile := (tmpdir++(./one.txt))
+ >> tmpfile:write("Hello world")
+ >> tmpfile:append("!")
+ >> tmpfile:read()
+ = "Hello world!"
+ >> tmpdir:files():has(tmpfile)
+ = yes
+
+ >> tmpfile:remove()
+
+ >> tmpdir:files():has(tmpfile)
+ = no
+
+ >> tmpdir:remove()
+