From a306f945571c8027badd2ca673304991f628900c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 9 Sep 2024 02:43:15 -0400 Subject: Add mktemp functionality --- test/paths.tm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/paths.tm (limited to 'test/paths.tm') 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() + -- cgit v1.2.3