This commit is contained in:
Kartik K. Agaram 2017-06-17 00:07:53 -07:00
parent d2e606f42f
commit 8fce01c150
4 changed files with 20 additions and 11 deletions

View File

@ -30,8 +30,7 @@ cd]
scenario editor-inserts-two-spaces-and-wraps-line-on-tab [
local-scope
assume-screen 10/width, 5/height
s:text <- new [abcd]
e:&:editor <- new-editor s, 0/left, 5/right
e:&:editor <- new-editor [abcd], 0/left, 5/right
editor-render screen, e
$clear-trace
assume-console [
@ -1178,8 +1177,7 @@ ghi]
scenario editor-moves-to-top-line-in-presence-of-wrapped-line [
local-scope
assume-screen 10/width, 5/height
s:text <- new [abcde]
e:&:editor <- new-editor s, 0/left, 5/right
e:&:editor <- new-editor [abcde], 0/left, 5/right
editor-render screen, e
screen-should-contain [
. .

View File

@ -425,12 +425,11 @@ def render-text screen:&:screen, s:text, left:num, right:num, color:num, row:num
move-cursor screen, row, left
]
scenario read-text-wraps-barely-long-lines [
scenario render-text-wraps-barely-long-lines [
local-scope
assume-screen 5/width, 5/height
s:text <- new [abcde]
run [
render-text screen, s, 0/left, 4/right, 7/white, 1/row
render-text screen, [abcde], 0/left, 4/right, 7/white, 1/row
]
screen-should-contain [
. .

View File

@ -30,8 +30,7 @@ cd]
scenario editor-inserts-two-spaces-and-wraps-line-on-tab [
local-scope
assume-screen 10/width, 5/height
s:text <- new [abcd]
e:&:editor <- new-editor s, 0/left, 5/right
e:&:editor <- new-editor [abcd], 0/left, 5/right
editor-render screen, e
$clear-trace
assume-console [
@ -1165,8 +1164,7 @@ ghi]
scenario editor-moves-to-top-line-in-presence-of-wrapped-line [
local-scope
assume-screen 10/width, 5/height
s:text <- new [abcde]
e:&:editor <- new-editor s, 0/left, 5/right
e:&:editor <- new-editor [abcde], 0/left, 5/right
editor-render screen, e
screen-should-contain [
. .

View File

@ -405,6 +405,20 @@ def render-text screen:&:screen, s:text, left:num, right:num, color:num, row:num
move-cursor screen, row, left
]
scenario render-text-wraps-barely-long-lines [
local-scope
assume-screen 5/width, 5/height
run [
render-text screen, [abcde], 0/left, 4/right, 7/white, 1/row
]
screen-should-contain [
. .
.abcd↩.
.e .
. .
]
]
# assumes programming environment has no sandboxes; restores them from previous session
def restore-sandboxes env:&:environment, resources:&:resources -> env:&:environment [
local-scope