Skip to content

Commit

Permalink
Merge pull request mitchellh#1 from cloudson/master
Browse files Browse the repository at this point in the history
Improve tests for documentation
  • Loading branch information
mitchellh committed Jul 13, 2014
2 parents 2a21ec2 + 75e2cc2 commit 2b080de
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: go
go:
- 1.0
- 1.1
- 1.2
script:
- go test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# colorstring
# colorstring [![Build Status](https://travis-ci.org/cloudson/colorstring.svg)](https://travis-ci.org/cloudson/colorstring)

colorstring is a [Go](http://www.golang.org) library for outputting colored
strings to a console using a simple inline syntax in your string to specify
Expand Down
16 changes: 16 additions & 0 deletions colorstring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ func TestColor(t *testing.T) {
Input: "foo[what]foo",
Output: "foo[what]foo",
},
{
Input: "foo[_blue_]foo",
Output: "foo\033[44mfoo\033[0m",
},
{
Input: "foo[bold]foo",
Output: "foo\033[1mfoo\033[0m",
},
{
Input: "[blue]foo[bold]bar",
Output: "\033[34mfoo\033[1mbar\033[0m",
},
{
Input: "[underline]foo[reset]bar",
Output: "\033[4mfoo\033[0mbar\033[0m",
},
}

for _, tc := range cases {
Expand Down

0 comments on commit 2b080de

Please sign in to comment.