rdf_test.go 565 B

12345678910111213141516171819202122232425
  1. package gold
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestRDFBrack(t *testing.T) {
  7. assert.Equal(t, "<test>", brack("test"))
  8. assert.Equal(t, "<test", brack("<test"))
  9. assert.Equal(t, "test>", brack("test>"))
  10. }
  11. func TestRDFDebrack(t *testing.T) {
  12. assert.Equal(t, "a", debrack("a"))
  13. assert.Equal(t, "test", debrack("<test>"))
  14. assert.Equal(t, "<test", debrack("<test"))
  15. assert.Equal(t, "test>", debrack("test>"))
  16. }
  17. func TestDefrag(t *testing.T) {
  18. assert.Equal(t, "test", defrag("test"))
  19. assert.Equal(t, "test", defrag("test#me"))
  20. }