diff options
author | 2017-11-19 21:10:04 -0800 | |
---|---|---|
committer | 2017-11-19 22:01:46 -0800 | |
commit | 8ffb773f43c8dc54801ca1d111854e7e881c93c9 (patch) | |
tree | 38133a2fc612597a75fed1d13e5b4042f58a2b7e /vendor/github.com/tdewolff/parse/css/util_test.go | |
download | v2-8ffb773f43c8dc54801ca1d111854e7e881c93c9.tar.gz v2-8ffb773f43c8dc54801ca1d111854e7e881c93c9.tar.zst v2-8ffb773f43c8dc54801ca1d111854e7e881c93c9.zip |
First commit
Diffstat (limited to 'vendor/github.com/tdewolff/parse/css/util_test.go')
-rw-r--r-- | vendor/github.com/tdewolff/parse/css/util_test.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vendor/github.com/tdewolff/parse/css/util_test.go b/vendor/github.com/tdewolff/parse/css/util_test.go new file mode 100644 index 00000000..9eb5aa93 --- /dev/null +++ b/vendor/github.com/tdewolff/parse/css/util_test.go @@ -0,0 +1,34 @@ +package css // import "github.com/tdewolff/parse/css" + +import ( + "testing" + + "github.com/tdewolff/test" +) + +func TestIsIdent(t *testing.T) { + test.That(t, IsIdent([]byte("color"))) + test.That(t, !IsIdent([]byte("4.5"))) +} + +func TestIsURLUnquoted(t *testing.T) { + test.That(t, IsURLUnquoted([]byte("http://x"))) + test.That(t, !IsURLUnquoted([]byte(")"))) +} + +func TestHsl2Rgb(t *testing.T) { + r, g, b := HSL2RGB(0.0, 1.0, 0.5) + test.T(t, r, 1.0) + test.T(t, g, 0.0) + test.T(t, b, 0.0) + + r, g, b = HSL2RGB(1.0, 1.0, 0.5) + test.T(t, r, 1.0) + test.T(t, g, 0.0) + test.T(t, b, 0.0) + + r, g, b = HSL2RGB(0.66, 0.0, 1.0) + test.T(t, r, 1.0) + test.T(t, g, 1.0) + test.T(t, b, 1.0) +} |