elvish/pkg/eval/vals/dissoc_test.go
Kurtis Rader 71cd3835bc Don't dot import pkg/tt
Qualified imports of pkg/tt outnumber unqualified (27 to 24). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
2022-06-04 23:39:19 +01:00

20 lines
373 B
Go

package vals
import (
"testing"
"src.elv.sh/pkg/tt"
)
type dissocer struct{}
func (dissocer) Dissoc(any) any { return "custom ret" }
func TestDissoc(t *testing.T) {
tt.Test(t, tt.Fn("Dissoc", Dissoc), tt.Table{
Args(MakeMap("k1", "v1", "k2", "v2"), "k1").Rets(eq(MakeMap("k2", "v2"))),
Args(dissocer{}, "x").Rets("custom ret"),
Args("", "x").Rets(nil),
})
}