elvish/pkg/testutil/set_test.go
Qi Xiao 3a3b8f5700 pkg/edit/complete: Change Complete to take an Evaler.
The PureEvaler abstraction made things unnecessarily complex; it's better to
just create a real Evaler for tests is pretty.

The Evaler has a new ReplaceBuiltin method to make it easier to construct the
expected test result.
2022-04-11 21:39:29 +01:00

18 lines
277 B
Go

package testutil
import "testing"
func TestSet(t *testing.T) {
c := &cleanuper{}
s := "old"
Set(c, &s, "new")
if s != "new" {
t.Errorf("After Set, s = %q, want %q", s, "new")
}
c.runCleanups()
if s != "old" {
t.Errorf("After Set, s = %q, want %q", s, "old")
}
}