MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Test_isValid

Function Test_isValid

valid_parentheses_20/solution_test.go:8–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func Test_isValid(t *testing.T) {
9 type args struct {
10 s string
11 }
12 tests := []struct {
13 name string
14 args args
15 want bool
16 }{
17 {
18 name: "valid parenthesis",
19 args: args{
20 s: "()",
21 },
22 want: true,
23 },
24 {
25 name: "valid parenthesis",
26 args: args{
27 s: "((",
28 },
29 want: false,
30 },
31 {
32 name: "valid parenthesis",
33 args: args{
34 s: "",
35 },
36 want: true,
37 },
38 {
39 name: "valid parenthesis",
40 args: args{
41 s: "()[]{}",
42 },
43 want: true,
44 },
45 {
46 name: "valid parenthesis",
47 args: args{
48 s: "(]",
49 },
50 want: false,
51 },
52 {
53 name: "valid parenthesis",
54 args: args{
55 s: "([)]",
56 },
57 want: false,
58 },
59 {
60 name: "valid parenthesis",
61 args: args{
62 s: "{[]}",
63 },
64 want: true,
65 },

Callers

nothing calls this directly

Calls 1

isValidFunction · 0.85

Tested by

no test coverage detected