You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
452 B

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)
}
}
}