func (m mapToNextMap) Check() (bool, string) { u := universe.LoadFromString(m.Input) u.Toroidal = m.Toroidal u.Next() message := "Answer:\n" + m.Answer + "\nGuess:\n" + u.String() + "\nInput:\n" + m.Input + "\n" return u.String() == m.Answer, message }
//------------------- // Finally, the tests... func TestSize(t *testing.T) { u := universe.LoadFromCanonicalString("3,2,f|0,0,") if u.Width != 3 || u.Height != 2 { t.Error("Size does not match") } u = universe.LoadFromString("..\n..\n..\n") if u.Width != 2 || u.Height != 3 { t.Error("Size does not match") } }