package dict import ( "reflect" "testing" ) func TestSoftMerge(t *testing.T) { testCases := loadDictDictToDictTestCases("test_data/soft_merge_cases.yaml") for _, testCase := range testCases { SoftMerge(&testCase.Dict1, testCase.Dict2) if !reflect.DeepEqual(testCase.Dict1, testCase.Result) { t.Errorf("Expected dict to be %v, got %v", testCase.Result, testCase.Dict1) } } } func TestSoftMergeWith(t *testing.T) { testCases := loadDictDictToDictTestCases("test_data/soft_merge_cases.yaml") for _, testCase := range testCases { testCase.Dict1.SoftMergeWith(testCase.Dict2) if !reflect.DeepEqual(testCase.Dict1, testCase.Result) { t.Errorf("Expected dict to be %v, got %v", testCase.Result, testCase.Dict1) } } } func TestMerge(t *testing.T) { testCases := loadDictDictToDictTestCases("test_data/merge_cases.yaml") for _, testCase := range testCases { Merge(&testCase.Dict1, testCase.Dict2) if !reflect.DeepEqual(testCase.Dict1, testCase.Result) { t.Errorf("Expected dict to be %v, got %v", testCase.Result, testCase.Dict1) } } } func TestMergeWith(t *testing.T) { testCases := loadDictDictToDictTestCases("test_data/merge_cases.yaml") for _, testCase := range testCases { testCase.Dict1.MergeWith(testCase.Dict2) if !reflect.DeepEqual(testCase.Dict1, testCase.Result) { t.Errorf("Expected dict to be %v, got %v", testCase.Result, testCase.Dict1) } } }