Skip to content

Commit 84ac439

Browse files
committed
new wrapstring test
1 parent 83513aa commit 84ac439

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_graphics_wrapString.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,9 @@ lines = g.wrapString(require("Storage").read("x"), 176)
137137
require("Storage").erase("x")
138138
SHOULD_BE(lines, ["Compacting...","Takes approx","1 minute"]);
139139

140+
// Issues when word-wrapping with a word with multiple hyphens
141+
g.clear().setFont("4x6");
142+
lines = g.wrapString("A a-b-c-d-e-f-g-h-i one two 3 one two 3 one two 3 one two 3", 40).map(t=>[t,g.stringWidth(t)])
143+
SHOULD_BE(lines, [["A a-b-c-d-",40],["e-f-g-h-i",36],["one two 3",36],["one two 3",36],["one two 3",36],["one two 3",36]]);
144+
140145
result = ok;

0 commit comments

Comments
 (0)