Skip to content

Commit 6db3f38

Browse files
committed
Add stacked ANSI wrap reapply order test
1 parent b80c354 commit 6db3f38

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

spec/unit/wrap/wrap_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@
186186
].join("\n"))
187187
end
188188

189+
it "applies stacked ANSI colors after wrapping" do
190+
text = "aaaa \e[31mbbbb \e[32mcc"
191+
expect(Strings::Wrap.wrap(text, 5)).to eq([
192+
"aaaa ",
193+
"\e[31mbbbb \e[0m",
194+
"\e[31m\e[32mcc\e[0m\e[0m"
195+
].join("\n"))
196+
end
197+
189198
it "applies ANSI codes when below wrap width" do
190199
str = "\e[32mone\e[0m\e[33mtwo\e[0m"
191200

0 commit comments

Comments
 (0)