mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
pkg/eval: Test GoFn's Elvish value methods.
This commit is contained in:
parent
07a9e781a6
commit
7ad3f6aa24
|
@ -3,11 +3,24 @@ package eval
|
|||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
"unsafe"
|
||||
|
||||
"github.com/elves/elvish/pkg/eval/errs"
|
||||
"github.com/elves/elvish/pkg/eval/vals"
|
||||
"github.com/xiaq/persistent/hash"
|
||||
)
|
||||
|
||||
func TestGoFnAsValue(t *testing.T) {
|
||||
fn1 := NewGoFn("fn1", func() {})
|
||||
fn2 := NewGoFn("fn2", func() {})
|
||||
vals.TestValue(t, fn1).
|
||||
Kind("fn").
|
||||
Hash(hash.Pointer(unsafe.Pointer(fn1))).
|
||||
Equal(fn1).
|
||||
NotEqual(fn2).
|
||||
Repr("<builtin fn1>")
|
||||
}
|
||||
|
||||
type testOptions struct {
|
||||
Foo string
|
||||
Bar string
|
||||
|
|
Loading…
Reference in New Issue
Block a user