package hx_target

import (
	"testing"
)

func TestHxTarget(t *testing.T) {
	swap := NewHxTarget()
	if swap == nil {
		t.Fatalf("swap==nil")
	}
	if tag := swap.Get(); tag != "" {
		t.Fatalf("tag not empty")
	}
	swap.Set("#main")
	if tag := swap.Get(); tag != "#main" {
		t.Fatalf("tag bad")
	}
	if str := swap.String(); str != `hx-target="#main"` {
		t.Fatalf("str is bad")
	}
}
