Loading internal/pkg/board/board_test.go +19 −0 Original line number Diff line number Diff line package board import ( "encoding/json" "reflect" "testing" ) func TestPoints(t *testing.T) { ps := Points() b, err := json.MarshalIndent(ps, "", " ") if err != nil { t.Fatalf("json.MarshalIndent() failed with: %s", err) } t.Logf("JSON: %s", string(b)) var ps1 []Point if err := json.Unmarshal(b, &ps1); err != nil { t.Fatalf("(json.Unmarshal) failed with: %s", err) } if !reflect.DeepEqual(ps, ps1) { t.Fatal("points do not match") } } func TestBoard(t *testing.T) { b := New() t.Logf("Board: %s", b) Loading Loading
internal/pkg/board/board_test.go +19 −0 Original line number Diff line number Diff line package board import ( "encoding/json" "reflect" "testing" ) func TestPoints(t *testing.T) { ps := Points() b, err := json.MarshalIndent(ps, "", " ") if err != nil { t.Fatalf("json.MarshalIndent() failed with: %s", err) } t.Logf("JSON: %s", string(b)) var ps1 []Point if err := json.Unmarshal(b, &ps1); err != nil { t.Fatalf("(json.Unmarshal) failed with: %s", err) } if !reflect.DeepEqual(ps, ps1) { t.Fatal("points do not match") } } func TestBoard(t *testing.T) { b := New() t.Logf("Board: %s", b) Loading