X-Git-Url: http://git.scottworley.com/slidingtile/blobdiff_plain/0d0e3b823054308d06cc50fcdba6b08b4373734f..212a5629d44cb0aa108057fe5a6d0c67bb479d54:/sliding_tile_test.go diff --git a/sliding_tile_test.go b/sliding_tile_test.go index 41be233..28392ee 100644 --- a/sliding_tile_test.go +++ b/sliding_tile_test.go @@ -3,26 +3,26 @@ package main import "testing" func Test_read_board_from_strings(t *testing.T) { - b, err := read_board_from_strings([]string{"1","2","9","12","6","8","13","14","0","11","15","3","7","4","10","5"}) - if err != nil || *b != Board([BOARD_SIZE]Space{1,2,9,12,6,8,13,14,0,11,15,3,7,4,10,5}) { - t.Fail() - } + b, err := read_board_from_strings([]string{"1", "2", "9", "12", "6", "8", "13", "14", "0", "11", "15", "3", "7", "4", "10", "5"}) + if err != nil || *b != Board([BOARD_SIZE]Space{1, 2, 9, 12, 6, 8, 13, 14, 0, 11, 15, 3, 7, 4, 10, 5}) { + t.Fail() + } - // Not enough - b, err = read_board_from_strings([]string{"1","2","9","12","6","8","13","14","0","11","15","3","7","4","10"}) - if err == nil { - t.Fail() - } + // Not enough + b, err = read_board_from_strings([]string{"1", "2", "9", "12", "6", "8", "13", "14", "0", "11", "15", "3", "7", "4", "10"}) + if err == nil { + t.Fail() + } - // Not an integer - b, err = read_board_from_strings([]string{"1","foo","9","12","6","8","13","14","0","11","15","3","7","4","10","5"}) - if err == nil { - t.Fail() - } + // Not an integer + b, err = read_board_from_strings([]string{"1", "foo", "9", "12", "6", "8", "13", "14", "0", "11", "15", "3", "7", "4", "10", "5"}) + if err == nil { + t.Fail() + } - // Empty string - b, err = read_board_from_strings([]string{"1","","9","12","6","8","13","14","0","11","15","3","7","4","10","5"}) - if err == nil { - t.Fail() - } + // Empty string + b, err = read_board_from_strings([]string{"1", "", "9", "12", "6", "8", "13", "14", "0", "11", "15", "3", "7", "4", "10", "5"}) + if err == nil { + t.Fail() + } }