mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +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.
8 lines
113 B
Go
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 })
|
|
}
|