Commit 99e58b32 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Add test, change env variable name

parent 4eee7105
#!/usr/bin/env lua #!/usr/bin/env lua
local VISUALTEST = os.getenv("VISUALTEST") local VISUALDELAY = os.getenv("VISUALDELAY")
local visual = VISUALTEST or false local visual = VISUALDELAY or false
local visual_delay = VISUALTEST and (tonumber(VISUALTEST)) or 0.1 local visual_delay = VISUALDELAY and (tonumber(VISUALDELAY)) or 0.1
local signal = require("posix.signal") local signal = require("posix.signal")
local unistd = require("posix.unistd") local unistd = require("posix.unistd")
...@@ -133,6 +133,25 @@ describe("htop test suite", function() ...@@ -133,6 +133,25 @@ describe("htop test suite", function()
send(curses.KEY_DOWN, 3) send(curses.KEY_DOWN, 3)
send(curses.KEY_F10) send(curses.KEY_F10)
end) end)
running_it("adds and removes PPID column", function()
send("S")
send(curses.KEY_DOWN, 3)
send(curses.KEY_RIGHT, 2)
send(curses.KEY_DOWN, 2)
send("\n")
send(curses.KEY_F10)
delay(0.2)
local ppid = check_string_at(2, pos_panelhdr, "PPID")
send("S")
send(curses.KEY_DOWN, 3)
send(curses.KEY_RIGHT, 1)
send(curses.KEY_DC)
send(curses.KEY_F10)
delay(0.2)
local not_ppid = check_string_at(2, pos_panelhdr, "PPID")
assert.equal(check(ppid))
assert.not_equal(check(not_ppid))
end)
running_it("changes CPU affinity for a process", function() running_it("changes CPU affinity for a process", function()
send("a") send("a")
send(" \n") send(" \n")
...@@ -146,7 +165,7 @@ describe("htop test suite", function() ...@@ -146,7 +165,7 @@ describe("htop test suite", function()
send("\n") send("\n")
local time = check_string_at(41, 2, "Time") local time = check_string_at(41, 2, "Time")
send(curses.KEY_DC) send(curses.KEY_DC)
delay(0.1) delay(0.3)
local not_time = check_string_at(41, 2, "Time") local not_time = check_string_at(41, 2, "Time")
send(ESC) send(ESC)
assert.equal(check(time)) assert.equal(check(time))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment