From a5e5a8af3e76ff9597ddbffe379d2eca87024e9c Mon Sep 17 00:00:00 2001 From: Arjen Brouwer Date: Fri, 20 Sep 2024 22:28:26 +0200 Subject: [PATCH] Fixing testcases --- tests/postgres/generator_test.go | 4 ++-- tests/postgres/scan_test.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/postgres/generator_test.go b/tests/postgres/generator_test.go index 682d9d37..05254e6c 100644 --- a/tests/postgres/generator_test.go +++ b/tests/postgres/generator_test.go @@ -602,12 +602,12 @@ func TestGeneratedAllTypesSQLBuilderFiles(t *testing.T) { testutils.AssertFileNamesEqual(t, modelDir, "all_types.go", "all_types_view.go", "employee.go", "link.go", "mood.go", "person.go", "person_phone.go", "weird_names_table.go", "level.go", "user.go", "floats.go", "people.go", - "components.go", "vulnerabilities.go", "all_types_materialized_view.go", "sample_ranges.go") + "components.go", "vulnerabilities.go", "all_types_materialized_view.go", "sample_ranges.go", "sample_arrays.go") testutils.AssertFileContent(t, modelDir+"/all_types.go", allTypesModelContent) testutils.AssertFileNamesEqual(t, tableDir, "all_types.go", "employee.go", "link.go", "person.go", "person_phone.go", "weird_names_table.go", "user.go", "floats.go", "people.go", "table_use_schema.go", - "components.go", "vulnerabilities.go", "sample_ranges.go") + "components.go", "vulnerabilities.go", "sample_ranges.go", "sample_arrays.go") testutils.AssertFileContent(t, tableDir+"/all_types.go", allTypesTableContent) testutils.AssertFileContent(t, tableDir+"/sample_ranges.go", sampleRangeTableContent) diff --git a/tests/postgres/scan_test.go b/tests/postgres/scan_test.go index f195f30c..e617c845 100644 --- a/tests/postgres/scan_test.go +++ b/tests/postgres/scan_test.go @@ -954,7 +954,6 @@ func TestScanIntoCustomBaseTypes(t *testing.T) { type MyFloat32 float32 type MyFloat64 float64 type MyString string - type MyStringArray pq.StringArray type MyTime = time.Time type film struct { @@ -969,13 +968,13 @@ func TestScanIntoCustomBaseTypes(t *testing.T) { ReplacementCost MyFloat64 Rating *model.MpaaRating LastUpdate MyTime - SpecialFeatures MyStringArray + SpecialFeatures pq.StringArray Fulltext MyString } // We'll skip special features, because it's a slice and it does not implement sql.Scanner stmt := SELECT( - Film.AllColumns.Except(Film.SpecialFeatures), + Film.AllColumns, ).FROM( Film, ).ORDER_BY(