-
-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zaq? Wiedmann
committed
May 18, 2022
1 parent
4bed36e
commit 8109749
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package mergo | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
"time" | ||
) | ||
|
||
type transformer struct { | ||
} | ||
|
||
func (s *transformer) Transformer(t reflect.Type) func(dst, src reflect.Value) error { | ||
return nil | ||
} | ||
|
||
func Test_deepMergeTransformerInvalidDestination(t *testing.T) { | ||
foo := time.Time{} | ||
src := reflect.ValueOf(foo) | ||
deepMerge(reflect.Value{}, src, make(map[uintptr]*visit), 0, &Config{ | ||
Transformers: &transformer{}, | ||
}) | ||
// this test is intentionally not asserting on anything, it's sole | ||
// purpose to verify deepMerge doesn't panic when a transformer is | ||
// passed and the destination is invalid. | ||
} |