hx_url_method_test.go 443 B

12345678910111213141516171819202122
  1. package hx_url_method
  2. import (
  3. "testing"
  4. "gitp78su.ipnodns.ru/svi/kern/v4/d0"
  5. )
  6. func TestHxUrlMethod(t *testing.T) {
  7. owner:=d0.LetOwner(1,"test_owner")
  8. swap := NewHxUrlMethod(owner)
  9. if swap == nil {
  10. t.Fatalf("swap==nil")
  11. }
  12. if method := swap.Method(); method.Get() != "hx-post" {
  13. t.Fatalf("tag not empty")
  14. }
  15. swap.Set(d0.LetTxt(owner, "hx-get"))
  16. if method := swap.Method(); method.Get() != "hx-get" {
  17. t.Fatalf("tag bad")
  18. }
  19. }