fixing test

This commit is contained in:
Marco Ronchese 2022-12-17 17:19:34 +01:00
parent 78ed3fdb13
commit 68dbbabb99

View file

@ -660,8 +660,8 @@ ORDER BY city.city_id, address.address_id, customer.customer_id;
`) `)
} }
// Test join with sql.NullInt64 primary keys // Test join with custom primary keys (sql.NullInt64)
func TestExecution5(t *testing.T) { func TestExecutionCustomPKTypes1(t *testing.T) {
var dest []struct { var dest []struct {
CityID sql.NullInt64 `sql:"primary_key" alias:"city.city_id"` CityID sql.NullInt64 `sql:"primary_key" alias:"city.city_id"`
@ -713,36 +713,60 @@ ORDER BY city.city_id, address.address_id, customer.customer_id;
testutils.AssertJSON(t, dest, ` testutils.AssertJSON(t, dest, `
[ [
{ {
"CityID": 312, "CityID": {
"Int64": 312,
"Valid": true
},
"CityName": "London", "CityName": "London",
"Customers": [ "Customers": [
{ {
"CustomerID": 252, "CustomerID": {
"Int64": 252,
"Valid": true
},
"LastName": "Hoffman", "LastName": "Hoffman",
"Address": { "Address": {
"AddressID": 256, "AddressID": {
"Int64": 256,
"Valid": true
},
"AddressLine": "1497 Yuzhou Drive" "AddressLine": "1497 Yuzhou Drive"
} }
}, },
{ {
"CustomerID": 512, "CustomerID": {
"Int64": 512,
"Valid": true
},
"LastName": "Vines", "LastName": "Vines",
"Address": { "Address": {
"AddressID": 517, "AddressID": {
"Int64": 517,
"Valid": true
},
"AddressLine": "548 Uruapan Street" "AddressLine": "548 Uruapan Street"
} }
} }
] ]
}, },
{ {
"CityID": 589, "CityID": {
"Int64": 589,
"Valid": true
},
"CityName": "York", "CityName": "York",
"Customers": [ "Customers": [
{ {
"CustomerID": 497, "CustomerID": {
"Int64": 497,
"Valid": true
},
"LastName": "Sledge", "LastName": "Sledge",
"Address": { "Address": {
"AddressID": 502, "AddressID": {
"Int64": 502,
"Valid": true
},
"AddressLine": "1515 Korla Way" "AddressLine": "1515 Korla Way"
} }
} }