scrabblego/main_test.go

19 lines
452 B
Go
Raw Permalink Normal View History

2019-10-10 12:36:44 +00:00
package main
import "testing"
func TestScrabbleScore(t *testing.T) {
testscores := map[string]int{
"spada del potere": 35,
"puppami la fava": 39,
"yogurt alla papaja": 49,
"jack": 16,
"mela": 8,
}
for testword, testscore := range testscores {
if score := scrabbleScore(testword); score != testscore {
t.Errorf("Expected word \"%s\" to have score %d but got %d", testword, testscore, score)
}
}
}