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/helpers.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/helpers.lua')
| -rw-r--r-- | spec/helpers.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers.lua b/spec/helpers.lua new file mode 100644 index 0000000..8f766e7 --- /dev/null +++ b/spec/helpers.lua | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | local busted = require("busted") | ||
| 2 | |||
| 3 | local function is_windows() | ||
| 4 | return package.config:sub(1,1) == "\\" | ||
| 5 | end | ||
| 6 | |||
| 7 | local function postfixer(postfix) | ||
| 8 | return function(description, ...) | ||
| 9 | return busted.pending(description.." ["..postfix.."]", ...) | ||
| 10 | end | ||
| 11 | end | ||
| 12 | |||
| 13 | -- win_it only executes on Windows, and is "pending" otherwise | ||
| 14 | win_it = is_windows() and busted.it or postfixer("Windows only") | ||
| 15 | -- nix_it only executes on Unix/Mac, and is "pending" otherwise | ||
| 16 | nix_it = is_windows() and postfixer("Unix/Mac only") or busted.it | ||
