package links import ( "strings" "testing" ) const ( ex1 = ` Ex 1 Example Page Posts ` ) func TestFindCountHrefs(t *testing.T) { r := strings.NewReader(ex1) hrefs, err := find(r) if err != nil { t.Error(err) } const expectedLen = 2 if actualLen := len(hrefs); actualLen != expectedLen { t.Errorf("got %d, want %d", actualLen, expectedLen) } }