From 0b6639fdaf16883cc81a6f31b62194377dfa592d Mon Sep 17 00:00:00 2001 From: esell Date: Fri, 5 Oct 2018 10:30:54 -0600 Subject: [PATCH] add unit tests for runtime/core - function --- pkg/runtime/core/function_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pkg/runtime/core/function_test.go diff --git a/pkg/runtime/core/function_test.go b/pkg/runtime/core/function_test.go new file mode 100644 index 00000000..85ff7f6c --- /dev/null +++ b/pkg/runtime/core/function_test.go @@ -0,0 +1,21 @@ +package core_test + +import ( + "testing" + + "github.com/MontFerret/ferret/pkg/runtime/core" + "github.com/MontFerret/ferret/pkg/runtime/values" + . "github.com/smartystreets/goconvey/convey" +) + +func TestValidateArgs(t *testing.T) { + Convey("Should match", t, func() { + a := []core.Value{values.NewInt(1), values.NewInt(2)} + + e := core.ValidateArgs(a, 1, 2) + So(e, ShouldBeNil) + + e = core.ValidateArgs(a, 3, 4) + So(e, ShouldNotBeNil) + }) +}