You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
503 B
25 lines
503 B
package genparen_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.jxs.me/leetgo/genparen"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestEmpty(t *testing.T) {
|
|
require.Equal(t, []string{""}, genparen.Gen(0))
|
|
}
|
|
|
|
func TestOne(t *testing.T) {
|
|
require.Equal(t, []string{"()"}, genparen.Gen(1))
|
|
}
|
|
|
|
func TestTwo(t *testing.T) {
|
|
require.Equal(t, []string{"(())", "()()"}, genparen.Gen(2))
|
|
}
|
|
|
|
func TestThree(t *testing.T) {
|
|
require.Equal(t, []string{"((()))", "(()())", "(())()", "()(())", "()()()"}, genparen.Gen(3))
|
|
}
|