elvish/pkg/testutil/set.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

8 lines
113 B
Go

package testutil
func Set[T any](c Cleanuper, p *T, v T) {
old := *p
*p = v
c.Cleanup(func() { *p = old })
}