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 [
|
2016-09-29 02:48:56 +00:00
|
|
|
local-scope
|
2015-07-28 21:33:22 +00:00
|
|
|
assume-screen 3/width, 2/height
|
2015-05-04 18:11:35 +00:00
|
|
|
run [
|
2016-09-17 07:31:55 +00:00
|
|
|
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 [
|
2016-09-29 02:48:56 +00:00
|
|
|
local-scope
|
2015-07-28 21:33:22 +00:00
|
|
|
assume-screen 5/width, 3/height
|
2016-09-29 02:48:56 +00:00
|
|
|
# print a character
|
|
|
|
a:char <- copy 97/a
|
2017-06-22 17:28:26 +00:00
|
|
|
screen <- print screen, a
|
2016-09-29 02:48:56 +00:00
|
|
|
# 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 [
|
|
|
|
. .
|
|
|
|
. .
|
|
|
|
. .
|
|
|
|
]
|
|
|
|
]
|
2017-06-22 17:29:38 +00:00
|
|
|
|
|
|
|
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 .
|
|
|
|
]
|
|
|
|
]
|