add: leetcode 0794 test

This commit is contained in:
tphyhFighting
2021-12-09 13:26:17 +08:00
parent b4e77f1457
commit 30871db28e

View File

@ -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")
}