diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2024-03-24 15:02:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-24 15:02:15 +0100 |
commit | 47c24eed0191f8f72646be63dee94ac2b35eb062 (patch) | |
tree | 808fc02c608fd56e93cd502069adcba9c561df7d /spec/04-term_helper.lua | |
parent | 8fe13074a7d9fdd88c5423d1e9c5fcc4ec43a57b (diff) | |
download | luasystem-47c24eed0191f8f72646be63dee94ac2b35eb062.tar.gz luasystem-47c24eed0191f8f72646be63dee94ac2b35eb062.tar.bz2 luasystem-47c24eed0191f8f72646be63dee94ac2b35eb062.zip |
chore(test): add tests (manual) for isatty terminal function (#22)
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 | }]])) | ||