aboutsummaryrefslogtreecommitdiff
path: root/spec/04-term_helper.lua
blob: 7fd39d21f2b07050653eed8c6eb41c7cbf949c30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
-- sub-script executed for isatty test
local writefile = require("pl.utils").writefile
local isatty = require("system").isatty
assert(arg[1] == "--", "missing -- argument")
local tempfile = assert(arg[2], "missing tempfile argument")

-- print("my temp file: ", tempfile)

assert(writefile(tempfile, [[{
  stdin = ]]..tostring(isatty(io.stdin))..[[,
  stdout = ]]..tostring(isatty(io.stdout))..[[,
  stderr = ]]..tostring(isatty(io.stderr))..[[,
}]]))