diff options
Diffstat (limited to 'spec/04-term_helper.lua')
-rw-r--r-- | spec/04-term_helper.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/04-term_helper.lua b/spec/04-term_helper.lua new file mode 100644 index 0000000..7fd39d2 --- /dev/null +++ b/spec/04-term_helper.lua | |||
@@ -0,0 +1,13 @@ | |||
1 | -- sub-script executed for isatty test | ||
2 | local writefile = require("pl.utils").writefile | ||
3 | local isatty = require("system").isatty | ||
4 | assert(arg[1] == "--", "missing -- argument") | ||
5 | local tempfile = assert(arg[2], "missing tempfile argument") | ||
6 | |||
7 | -- print("my temp file: ", tempfile) | ||
8 | |||
9 | assert(writefile(tempfile, [[{ | ||
10 | stdin = ]]..tostring(isatty(io.stdin))..[[, | ||
11 | stdout = ]]..tostring(isatty(io.stdout))..[[, | ||
12 | stderr = ]]..tostring(isatty(io.stderr))..[[, | ||
13 | }]])) | ||