Skip to content

Commit

Permalink
implement getconsoleflags tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed May 20, 2024
1 parent dcd5d62 commit 60a49e3
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions spec/04-term_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,22 @@ describe("Terminal:", function()



pending("getconsoleflags()", function()

pending("returns the consoleflags, if called without flags", function()
print"1"
package.loaded["system"] = nil
package.loaded["system.core"] = nil
print"2"
local system = require "system"
print"3"
for k,v in pairs(system) do print(k,v) end
for k,v in pairs(debug.getinfo(system.isatty)) do print(k,v) end
describe("getconsoleflags()", function()

win_it("returns the consoleflags #manual", function()
local flags, err = system.getconsoleflags(io.stdin)
assert.is_nil(err)
assert.is_integer(flags)
assert.is_userdata(flags)
assert.equals("bitflags:", tostring(flags):sub(1,9))
end)


nix_it("returns the consoleflags, as value 0", function()
local flags, err = system.getconsoleflags(io.stdin)
assert.is_nil(err)
assert.is_userdata(flags)
assert.equals("bitflags:", tostring(flags):sub(1,9))
assert.equals(0, flags:value())
end)

end)
Expand Down

0 comments on commit 60a49e3

Please sign in to comment.