package concurrency import ( "reflect" "testing" ) func mockWebsiteChecker(url string) bool { return url != "waat://furhurterwe.geds" } func TestWebsites(t *testing.T) { websites := []string{ "http://google.com", "http://hackaday.com", "waat://furhurterwe.geds", } want := map[string]bool{ "http://google.com": true, "http://hackaday.com": true, "waat://furhurterwe.geds": false, } got := CheckWebsites(mockWebsiteChecker, websites) if !reflect.DeepEqual(want, got) { t.Fatalf("Wanted %v, got %v", want, got) } }