diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-09 14:06:55 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-09 14:06:55 +0200 |
commit | ca31258cd24d7f7951f14644fe592724579a53b8 (patch) | |
tree | 5169bf7e118761bd2958f9a3f023c815d5cd2f51 /util/text_test.go | |
parent | bf0a855f0cbdc2ea1e4a250b7152272982ffb611 (diff) | |
download | git-bug-ca31258cd24d7f7951f14644fe592724579a53b8.tar.gz git-bug-ca31258cd24d7f7951f14644fe592724579a53b8.zip |
TextWrap: support text with color escape sequence
Diffstat (limited to 'util/text_test.go')
-rw-r--r-- | util/text_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/text_test.go b/util/text_test.go index f7e1fabf..09b6b4d6 100644 --- a/util/text_test.go +++ b/util/text_test.go @@ -65,6 +65,12 @@ func TestTextWrap(t *testing.T) { "\nfoo\nbar\n\n\nbaz\n", 4, }, + // Ignore complete words with terminal color sequence + { + "foo \x1b[31mbar\x1b[0m baz", + "foo\n\x1b[31mbar\x1b[0m\nbaz", + 4, + }, // Complete example: { " This is a list: \n\n\t* foo\n\t* bar\n\n\n\t* baz \nBAM ", |