mu/083scenario_screen_test.mu

48 lines
911 B
Plaintext
Raw Normal View History

2015-05-04 18:11:35 +00:00
# To check our support for screens in scenarios, rewrite tests from print.mu
2015-08-09 19:26:31 +00:00
scenario print-character-at-top-left-2 [
local-scope
assume-screen 3/width, 2/height
2015-05-04 18:11:35 +00:00
run [
a:char <- copy 97/a
2017-06-22 17:28:26 +00:00
screen <- print screen, a
2015-05-04 18:11:35 +00:00
]
screen-should-contain [
.a .
. .
]
]
2015-08-09 19:26:31 +00:00
scenario clear-line-erases-printed-characters-2 [
local-scope
assume-screen 5/width, 3/height
# print a character
a:char <- copy 97/a
2017-06-22 17:28:26 +00:00
screen <- print screen, a
# move cursor to start of line
2017-06-22 17:28:26 +00:00
screen <- move-cursor screen, 0/row, 0/column
2015-05-04 18:11:35 +00:00
run [
2017-06-22 17:28:26 +00:00
screen <- clear-line screen
2015-05-04 18:11:35 +00:00
]
screen-should-contain [
. .
. .
. .
]
]
scenario scroll-screen [
local-scope
assume-screen 3/width, 2/height
run [
a:char <- copy 97/a
move-cursor screen, 1/row, 2/column
screen <- print screen, a
screen <- print screen, a
]
screen-should-contain [
. a.
.a .
]
]