hash_test.go 497 B

12345678910111213141516
  1. package css // import "github.com/tdewolff/parse/css"
  2. import (
  3. "testing"
  4. "github.com/tdewolff/test"
  5. )
  6. func TestHashTable(t *testing.T) {
  7. test.T(t, ToHash([]byte("font")), Font, "'font' must resolve to hash.Font")
  8. test.T(t, Font.String(), "font")
  9. test.T(t, Margin_Left.String(), "margin-left")
  10. test.T(t, ToHash([]byte("")), Hash(0), "empty string must resolve to zero")
  11. test.T(t, Hash(0xffffff).String(), "")
  12. test.T(t, ToHash([]byte("fonts")), Hash(0), "'fonts' must resolve to zero")
  13. }