From 9d138173be9845fc7f2cbeab58b41f27a1f8043f Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 23 Mar 2015 01:24:31 +0900 Subject: Fix #155 - Empty ANSI color code to reset color state --- src/ansi_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ansi_test.go') diff --git a/src/ansi_test.go b/src/ansi_test.go index d5e0e432..be982eb4 100644 --- a/src/ansi_test.go +++ b/src/ansi_test.go @@ -45,6 +45,14 @@ func TestExtractColor(t *testing.T) { assert(offsets[0], 0, 11, -1, -1, true) }) + src = "\x1b[1mhello \x1b[mworld" + check(func(offsets []ansiOffset) { + if len(offsets) != 1 { + t.Fail() + } + assert(offsets[0], 0, 6, -1, -1, true) + }) + src = "hello \x1b[34;45;1mworld" check(func(offsets []ansiOffset) { if len(offsets) != 1 { -- cgit v1.2.3