7
Antworten
Ich habe einen table-driven test Fall wie diesem: func CountWords(s string) map[string]int func TestCountWords(t *testing.T) { var tests = struct { input string want map[string]int }{ {"foo", map[string]int{"foo":1}}, {"foo bar foo", map[string]int{"foo":2,"bar":1}}, } for i, c :=
3
Antworten
Was sind Table-Driven-Methoden wie bereits erwähnt, die von Bill Gates auf Vista Werbung auf http://www.youtube.com/watch?v=gBWPf1BWtkw Das video ist privat. Ist es eine Kopie irgendwo? InformationsquelleAutor Jonathan | 2008-09-19
4
Antworten
Ich habe einen table-driven test Fall wie diesem: func CountWords(s string) map[string]int func TestCountWords(t *testing.T) { var tests = struct { input string want map[string]int }{ {"foo", map[string]int{"foo":1}}, {"foo bar foo", map[string]int{"foo":2,"bar":1}}, } for i, c :=