提交 bc91fffd 编写于 作者: 张文治(治)'s avatar 张文治(治)

Add new file

上级 083dcb42
package algorithmstest
import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
"wenzhi.cn/grammer/src/algorithms"
dataStructure "wenzhi.cn/grammer/src/datastructure"
)
// Testify 框架:首字母必须大写
func TestCountDifferentSubsequenceGCDs(t *testing.T) {
assertResult := assert.New(t)
var tests = []struct {
input string
expected int
}{
{"[6,10,3]", 6},
{"[5,15,40,5,6]", 7},
}
for _, test := range tests {
nums := dataStructure.StringToInt1dArray(test.input)
fmt.Println(nums)
actual := algorithms.CountDifferentSubsequenceGCDs(nums)
fmt.Println("actual: ", actual)
assertResult.Equal(actual, test.expected)
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册