diff --git a/apply_test.go b/apply_test.go index 91ae8bc..bb50bae 100644 --- a/apply_test.go +++ b/apply_test.go @@ -26,6 +26,9 @@ func TestApply(t *testing.T) { f0io := func(out io.Writer, a s0, in io.Reader) { io.Copy(out, in); out.Write([]byte(a.Foo + a.Bar)) } f1 := func(a, b, c int) int { return a + b + c } f1a := func(a, b int, c ...int) int { return a + b + len(c) } + f1b := func(a, b, c **int) int { return **a + **b + **c } + f1c := func(a, b, c []int) int { return a[0] + b[0] + c[0] } + f1d := func(a, b, c **[]*int) int { return *(**a)[0] + *(**b)[0] + *(**c)[0] } f2 := func(a s2) bool { return a.Foo != a.Bar } t.Run("config", testExec(testCase{impl: f0, command: "foo", conf: "foo=bar"}, "", "bar")) t.Run("env", testExec(testCase{impl: f0, command: "foo", env: "foo_foo=bar"}, "", "bar")) @@ -108,6 +111,10 @@ func TestApply(t *testing.T) { "bar", ), ) + + t.Run("positional in pointer", testExec(testCase{impl: f1b, command: "foo 1 2 3"}, "", "6")) + t.Run("positional in pointer", testExec(testCase{impl: f1c, command: "foo 1 2 3"}, "", "6")) + t.Run("positional in pointer", testExec(testCase{impl: f1d, command: "foo 1 2 3"}, "", "6")) }) t.Run("output", func(t *testing.T) { diff --git a/notes.txt b/notes.txt deleted file mode 100644 index ebc97a6..0000000 --- a/notes.txt +++ /dev/null @@ -1,20 +0,0 @@ -turn testExec into a wandtesting package -use a type cache -check the teletype width for rendering -provide option for the markdown rendering width -support HTML doc rendering -test: -- nil return values -- options in variadic -- options in pointer -- options in slice -- options in slice and pointer -- parameters in pointers -- parameters in slices -- parameters in slices and pointers -- implementation in pointer -- implementation in slice => not accepted -- implementation in pointer and slice => not accepted -- plurality -- env parsing -- plurality in input validation