From 97ddfde68f36c46992d3bfbfff1cd354a5583bc3 Mon Sep 17 00:00:00 2001 From: Nick Tobey Date: Wed, 19 Feb 2025 16:57:37 -0800 Subject: [PATCH] Update type compatibility test. --- .../typecompatibility}/type_compatibility_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename go/libraries/doltcore/{merge => schema/typecompatibility}/type_compatibility_test.go (96%) diff --git a/go/libraries/doltcore/merge/type_compatibility_test.go b/go/libraries/doltcore/schema/typecompatibility/type_compatibility_test.go similarity index 96% rename from go/libraries/doltcore/merge/type_compatibility_test.go rename to go/libraries/doltcore/schema/typecompatibility/type_compatibility_test.go index 79cc1e8e58..24e3013e64 100644 --- a/go/libraries/doltcore/merge/type_compatibility_test.go +++ b/go/libraries/doltcore/schema/typecompatibility/type_compatibility_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package merge +package typecompatibility import ( "testing" @@ -73,7 +73,7 @@ var mediumBlob = mustCreateType(gmstypes.MustCreateBinary(sqltypes.Blob, 16_777_ // TestLd1IsTypeChangeCompatible tests that the LD1 TypeCompatibilityChecker implementation // correctly computes compatibility between types. func TestLd1IsTypeChangeCompatible(t *testing.T) { - compatChecker := newTypeCompatabilityCheckerForStorageFormat(storetypes.Format_LD_1) + compatChecker := NewTypeCompatabilityCheckerForStorageFormat(storetypes.Format_LD_1) runTypeCompatibilityTests(t, compatChecker, []typeChangeCompatibilityTest{ { name: "equivalent types are compatible", @@ -145,7 +145,7 @@ func TestLd1IsTypeChangeCompatible(t *testing.T) { // TestDoltIsTypeChangeCompatible tests that the DOLT TypeCompatibilityChecker implementation // correctly computes compatibility between types. func TestDoltIsTypeChangeCompatible(t *testing.T) { - compatChecker := newTypeCompatabilityCheckerForStorageFormat(storetypes.Format_DOLT) + compatChecker := NewTypeCompatabilityCheckerForStorageFormat(storetypes.Format_DOLT) runTypeCompatibilityTests(t, compatChecker, []typeChangeCompatibilityTest{ { name: "equivalent types are compatible", @@ -320,9 +320,9 @@ func runTypeCompatibilityTests(t *testing.T, compatChecker TypeCompatibilityChec for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { compatibilityResults := compatChecker.IsTypeChangeCompatible(tt.from, tt.to) - assert.Equal(t, tt.compatible, compatibilityResults.compatible, "expected compatible to be %t, but was %t", tt.compatible, compatibilityResults.compatible) - assert.Equal(t, tt.rewrite, compatibilityResults.rewriteRows, "expected rewrite required to be %t, but was %t", tt.rewrite, compatibilityResults.rewriteRows) - assert.Equal(t, tt.invalidateSecondaryIndexes, compatibilityResults.invalidateSecondaryIndexes, "expected secondary index rewrite to be %t, but was %t", tt.invalidateSecondaryIndexes, compatibilityResults.invalidateSecondaryIndexes) + assert.Equal(t, tt.compatible, compatibilityResults.Compatible, "expected compatible to be %t, but was %t", tt.compatible, compatibilityResults.Compatible) + assert.Equal(t, tt.rewrite, compatibilityResults.RewriteRows, "expected rewrite required to be %t, but was %t", tt.rewrite, compatibilityResults.RewriteRows) + assert.Equal(t, tt.invalidateSecondaryIndexes, compatibilityResults.InvalidateSecondaryIndexes, "expected secondary index rewrite to be %t, but was %t", tt.invalidateSecondaryIndexes, compatibilityResults.InvalidateSecondaryIndexes) }) }