...

Source file src/github.com/imdario/mergo/pr211_2_test.go

Documentation: github.com/imdario/mergo

     1  package mergo
     2  
     3  import (
     4  	"reflect"
     5  	"testing"
     6  	"time"
     7  )
     8  
     9  type transformer struct {
    10  }
    11  
    12  func (s *transformer) Transformer(t reflect.Type) func(dst, src reflect.Value) error {
    13  	return nil
    14  }
    15  
    16  func Test_deepMergeTransformerInvalidDestination(t *testing.T) {
    17  	foo := time.Time{}
    18  	src := reflect.ValueOf(foo)
    19  	deepMerge(reflect.Value{}, src, make(map[uintptr]*visit), 0, &Config{
    20  		Transformers: &transformer{},
    21  	})
    22  	// this test is intentionally not asserting on anything, it's sole
    23  	// purpose to verify deepMerge doesn't panic when a transformer is
    24  	// passed and the destination is invalid.
    25  }
    26  

View as plain text