package main import ( "fmt" "local/truckstop/config" "testing" ) func TestParseOutStates(t *testing.T) { input := `--0000000000006704ef05d5335639 Content-Type: text/plain; charset="UTF-8" NC the states should be ok GA SC --0000000000006704ef05d5335639 Content-Type: text/html; charset="UTF-8"
NC the states should be ok GA SC
--0000000000006704ef05d5335639--` want := []config.State{ config.State("NC"), config.State("OK"), config.State("GA"), config.State("SC"), config.State("NC"), config.State("OK"), config.State("GA"), config.State("SC"), } got := parseOutStates([]byte(input)) if fmt.Sprint(want) != fmt.Sprint(got) { t.Fatal(want, got) } }