You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bathyscaphe/internal/api/api_test.go

16 lines
336 B
Go

package api
import "testing"
func TestExtractTitle(t *testing.T) {
c := "hello this <title>is A</title>TEST"
if val := extractTitle(c); val != "is A" {
t.Errorf("Wanted: %s Got: %s", "is A", val)
}
c = "hello this is another test"
if val := extractTitle(c); val != "" {
t.Errorf("No matches should have been returned")
}
}