mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-30 18:41:45 +00:00
17
tests/stdlib/ttempfiles.nim
Normal file
17
tests/stdlib/ttempfiles.nim
Normal file
@@ -0,0 +1,17 @@
|
||||
import std/[os, tempfiles]
|
||||
|
||||
|
||||
doAssert createTempDir("nim", "tmp") != createTempDir("nim", "tmp")
|
||||
|
||||
block:
|
||||
var t1 = createTempFile("nim", ".tmp")
|
||||
var t2 = createTempFile("nim", ".tmp")
|
||||
doAssert t1.path != t2.path
|
||||
|
||||
write(t1.fd, "1234")
|
||||
doAssert readAll(t2.fd) == ""
|
||||
|
||||
close(t1.fd)
|
||||
close(t2.fd)
|
||||
removeFile(t1.path)
|
||||
removeFile(t2.path)
|
||||
Reference in New Issue
Block a user