mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-01 08:42:55 +08:00
3a3b8f5700
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.
18 lines
277 B
Go
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")
|
|
}
|
|
}
|