hx_url_test.go 511 B

123456789101112131415161718192021222324
  1. package hx_url
  2. import (
  3. "testing"
  4. "gitp78su.ipnodns.ru/svi/kern/v4/d0"
  5. )
  6. func TestHxUrl(t *testing.T) {
  7. owner := d0.LetOwner(1, "test_owner")
  8. swap := NewHxUrl(owner, d0.LetTxt(owner, "/wui/click/abc"))
  9. if swap == nil {
  10. t.Fatalf("swap==nil")
  11. }
  12. if met := swap.Method(); met == nil {
  13. t.Fatalf("met==nil")
  14. }
  15. if patch := swap.Patch(); patch == nil {
  16. t.Fatalf("patch==nil")
  17. }
  18. if str := swap.String(); str != `hx-post="/wui/click/abc"` {
  19. t.Fatalf(`str(%v)!=(hx-post="/wui/click/abc")`, str)
  20. }
  21. }