mirror of
https://github.com/MontFerret/ferret.git
synced 2025-01-18 03:22:02 +02:00
Merge pull request #50 from esell/runtime-tests2
add unit tests for runtime/core - function
This commit is contained in:
commit
1b2a765569
21
pkg/runtime/core/function_test.go
Normal file
21
pkg/runtime/core/function_test.go
Normal file
@ -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)
|
||||
})
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user