aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/tdewolff/parse/svg/hash_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/tdewolff/parse/svg/hash_test.go')
-rw-r--r--vendor/github.com/tdewolff/parse/svg/hash_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/github.com/tdewolff/parse/svg/hash_test.go b/vendor/github.com/tdewolff/parse/svg/hash_test.go
new file mode 100644
index 0000000..7038a15
--- /dev/null
+++ b/vendor/github.com/tdewolff/parse/svg/hash_test.go
@@ -0,0 +1,17 @@
+package svg // import "github.com/tdewolff/parse/svg"
+
+import (
+ "testing"
+
+ "github.com/tdewolff/test"
+)
+
+func TestHashTable(t *testing.T) {
+ test.T(t, ToHash([]byte("svg")), Svg, "'svg' must resolve to hash.Svg")
+ test.T(t, ToHash([]byte("width")), Width, "'width' must resolve to hash.Width")
+ test.T(t, Svg.String(), "svg")
+ test.T(t, ToHash([]byte("")), Hash(0), "empty string must resolve to zero")
+ test.T(t, Hash(0xffffff).String(), "")
+ test.T(t, ToHash([]byte("svgs")), Hash(0), "'svgs' must resolve to zero")
+ test.T(t, ToHash([]byte("uopi")), Hash(0), "'uopi' must resolve to zero")
+}