// Regression check to ensure that Halt().Replace() works at the top level.
Regression check to ensure that Halt().Replace() works at the top level.
// Regression check to ensure that Halt () . Replace () works at the top level .
func TestHaltReplaceTop(t *testing.T) {
	a := assert.New(t)
	d, _ := l.NewContainer(false)
	d2, changed, err := d.WalkTarget(func(ctx l.TargetContext, x l.Target) l.TargetDecision {
		return ctx.Halt().Replace(&l.ContainerType{ByRef: l.ByRefType{Val: "HaltReplace"}})
	})
	if !a.NoError(err) {
		return
	}
	a.True(changed)
	a.NotEqual(d, d2)
	a.Equal("HaltReplace", d2.ByRef.Val)
}
func TestHaltReplaceTop ( t * testing . T ) { a := assert . New ( t ) d , _ := l . NewContainer ( false ) d2 , changed , err := d . WalkTarget ( func ( ctx l . TargetContext , x l . Target ) l . TargetDecision { return ctx . Halt ( ) . Replace ( & l . ContainerType { ByRef : l . ByRefType { Val : " " } } ) } ) if ! a . NoError ( err ) { return } a . True ( changed ) a . NotEqual ( d , d2 ) a . Equal ( " " , d2 . ByRef . Val ) }
Regression check to ensure that Halt().Replace() works at the top level.
Regression check to ensure that Halt () . Replace () works at the top level .