hx_url_method_test.go 315 B

12345678910111213141516171819
  1. package hx_url_method
  2. import (
  3. "testing"
  4. )
  5. func TestHxUrlMethod(t *testing.T) {
  6. swap := NewHxUrlMethod()
  7. if swap == nil {
  8. t.Fatalf("swap==nil")
  9. }
  10. if tag := swap.Get(); tag != "hx-post" {
  11. t.Fatalf("tag not empty")
  12. }
  13. swap.Set("hx-get")
  14. if tag := swap.Get(); tag != "hx-get" {
  15. t.Fatalf("tag bad")
  16. }
  17. }