18 lines
452 B
Go
18 lines
452 B
Go
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)
|
|
}
|
|
}
|
|
}
|