package themes import ( "strings" "testing" ) func TestOneLevelOfIndentation(t *testing.T) { data := []byte("html\n head\n title\n body\n h1\n") got := OneLevelOfIndentation(&data, "body") if got != " " { t.Errorf("OneLevelOfIndentation = %q, want %q", got, " ") } // keyword not present got = OneLevelOfIndentation(&data, "footer") if got != "" { t.Errorf("OneLevelOfIndentation (missing keyword) = %q, want empty", got) } // tabs tabData := []byte("html\n\thead\n\t\ttitle\n\tbody\n") got = OneLevelOfIndentation(&tabData, "body") if got != "\t" { t.Errorf("OneLevelOfIndentation (tabs) = %q, want %q", got, "\t") } } func TestStyleHead(t *testing.T) { // Built-in theme should produce a