25 lines
395 B
Go
25 lines
395 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestMakeBoard(t *testing.T) {
|
|
board := makeBoard(2, 2, "_")
|
|
|
|
testBoard := [][]string{
|
|
[]string{"_", "_"},
|
|
[]string{"_", "_"},
|
|
}
|
|
|
|
if !reflect.DeepEqual(board, testBoard) {
|
|
fmt.Printf("Expected:\n")
|
|
printBoard(testBoard)
|
|
fmt.Printf("\nGot:\n")
|
|
printBoard(board)
|
|
t.Error("Failed: Arrays are different! See above!")
|
|
}
|
|
}
|