Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
1179906e
Commit
1179906e
authored
10 years ago
by
Hisham Muhammad
Browse files
Options
Download
Email Patches
Plain Diff
Add test, change env variable name
parent
63aa02c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test_spec.lua
+23
-4
test_spec.lua
with
23 additions
and
4 deletions
+23
-4
test_spec.lua
View file @
1179906e
#!/usr/bin/env lua
local
VISUAL
TEST
=
os.getenv
(
"VISUAL
TEST
"
)
local
VISUAL
DELAY
=
os.getenv
(
"VISUAL
DELAY
"
)
local
visual
=
VISUAL
TEST
or
false
local
visual_delay
=
VISUAL
TEST
and
(
tonumber
(
VISUAL
TEST
))
or
0
.
1
local
visual
=
VISUAL
DELAY
or
false
local
visual_delay
=
VISUAL
DELAY
and
(
tonumber
(
VISUAL
DELAY
))
or
0
.
1
local
signal
=
require
(
"posix.signal"
)
local
unistd
=
require
(
"posix.unistd"
)
...
...
@@ -133,6 +133,25 @@ describe("htop test suite", function()
send
(
curses
.
KEY_DOWN
,
3
)
send
(
curses
.
KEY_F10
)
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
()
send
(
"a"
)
send
(
" \n"
)
...
...
@@ -146,7 +165,7 @@ describe("htop test suite", function()
send
(
"
\n
"
)
local
time
=
check_string_at
(
41
,
2
,
"Time"
)
send
(
curses
.
KEY_DC
)
delay
(
0
.
1
)
delay
(
0
.
3
)
local
not_time
=
check_string_at
(
41
,
2
,
"Time"
)
send
(
ESC
)
assert
.
equal
(
check
(
time
))
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help