shithub: lu9-p9

ref: c85dc2c7a75a78c497c55ce5ad276f8f9fa04e17
dir: /extra/lfs_test.lua/

View raw version
#!/bin/lu9
local lfs = require "lfs"

for n in lfs.dir(".") do
	assert(type(n) == "string")
end
assert(lfs.attributes(".", "mode") == "directory")
local attr = assert(lfs.attributes("."))
assert(attr.mode == "directory")

local cwd = assert(lfs.currentdir())
assert(lfs.chdir("/"))
assert(lfs.currentdir() == "/")
assert(lfs.chdir(cwd))
assert(lfs.currentdir() == cwd)

assert(lfs.mkdir("DELETEME"))
assert(lfs.rmdir("DELETEME"))