package hx_swap

import (
	"testing"
)

func TestHxSwap(t *testing.T) {
	swap := NewHxSwap()
	if swap == nil {
		t.Fatalf("swap==nil")
	}
	if tag := swap.Get(); tag != "" {
		t.Fatalf("tag not empty")
	}
	swap.Set("innerHTML")
	if tag := swap.Get(); tag != "innerHTML" {
		t.Fatalf("tag bad")
	}
	if str := swap.String(); str != `hx-swap="innerHTML"` {
		t.Fatalf("str is bad")
	}
}
