go:make_board: Added Unit Test

This commit is contained in:
Logen Kain 2017-10-03 01:51:49 -07:00
parent 93e5494f70
commit 672cbdfb99

View File

@ -0,0 +1,24 @@
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!")
}
}