From 30871db28ebe23dc0f75f19ad788f90b4a0fa82a Mon Sep 17 00:00:00 2001 From: tphyhFighting <2363176358@qq.com> Date: Thu, 9 Dec 2021 13:26:17 +0800 Subject: [PATCH] add: leetcode 0794 test --- .../794.Valid Tic-Tac-Toe State_test.go | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 leetcode/0794.Valid-Tic-Tac-Toe-State/794.Valid Tic-Tac-Toe State_test.go diff --git a/leetcode/0794.Valid-Tic-Tac-Toe-State/794.Valid Tic-Tac-Toe State_test.go b/leetcode/0794.Valid-Tic-Tac-Toe-State/794.Valid Tic-Tac-Toe State_test.go new file mode 100644 index 00000000..b324954b --- /dev/null +++ b/leetcode/0794.Valid-Tic-Tac-Toe-State/794.Valid Tic-Tac-Toe State_test.go @@ -0,0 +1,55 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question794 struct { + para794 + ans794 +} + +// para 是参数 +type para794 struct { + board []string +} + +// ans 是答案 +type ans794 struct { + ans bool +} + +func Test_Problem794(t *testing.T) { + + qs := []question794{ + + { + para794{[]string{"O ", " ", " "}}, + ans794{false}, + }, + + { + para794{[]string{"XOX", " X ", " "}}, + ans794{false}, + }, + + { + para794{[]string{"XXX", " ", "OOO"}}, + ans794{false}, + }, + + { + para794{[]string{"XOX", "O O", "XOX"}}, + ans794{true}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 794------------------------\n") + + for _, q := range qs { + _, p := q.ans794, q.para794 + fmt.Printf("【input】:%v 【output】:%v\n", p.board, validTicTacToe(p.board)) + } + fmt.Printf("\n\n\n") +}