Skip to content

Commit 403f70c

Browse files
committed
test: Add NULL values to test data types
1 parent 0e38936 commit 403f70c

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

integration_test.go

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -191,25 +191,27 @@ func TestVerifyData(t *testing.T) {
191191
}
192192

193193
columnTypes := map[string][]string{
194-
"boolean": {"true", "false"},
195-
"bytea": {fmt.Sprintf("'%s'", hex.EncodeToString([]byte("convert this content to bytes")))},
196-
"bit(1)": {"'1'", "'0'"},
197-
"varbit(3)": {"'0'", "'1'", "'101'", "'010'"},
198-
199-
"bigint[]": {"'{602213950000000000, -1}'"},
200-
"integer": {"0", "123979", "-23974"},
201-
"double precision": {"69.123987", "-69.123987"},
202-
203-
"text": {`'foo'`, `'bar'`, `''`, `'something that is much longer but without much other complication'`},
204-
"uuid": {fmt.Sprintf("'%s'", uuid.New().String())},
205-
`character varying(64)`: {`'more string stuff'`},
206-
207-
"jsonb": {`'{}'`, `'{"foo": ["bar", "baz"]}'`, `'{"foo": "bar"}'`, `'{"foo": "bar", "baz": "qux"}'`, `'{"for sure?": true, "has numbers": 123.456, "this is": ["some", "json", "blob"]}'`},
208-
"json": {`'{}'`, `'{"foo": ["bar", "baz"]}'`, `'{"foo": "bar"}'`, `'{"foo": "bar", "baz": "qux"}'`, `'{"for sure?": true, "has numbers": 123.456, "this is": ["some", "json", "blob"]}'`},
209-
210-
"date": {`'2020-12-31'`},
211-
"timestamp with time zone": {`'2020-12-31 23:59:59 -8:00'`, `'2022-06-08 20:03:06.957223+00'`}, // hashes differently for psql/crdb, convert to epoch when hashing
212-
"timestamp without time zone": {`'2020-12-31 23:59:59'`},
194+
"boolean": {"true", "false", "NULL"},
195+
"bytea": {fmt.Sprintf("'%s'", hex.EncodeToString([]byte("convert this content to bytes"))), "NULL"},
196+
"bit(1)": {"'1'", "'0'", "NULL"},
197+
"varbit(3)": {"'0'", "'1'", "'101'", "'010'", "NULL"},
198+
199+
"bigint[]": {"'{602213950000000000, -1}'", "NULL"},
200+
"integer": {"0", "123979", "-23974", "NULL"},
201+
"double precision": {"69.123987", "-69.123987", "NULL"},
202+
203+
"text": {`'foo'`, `'bar'`, `''`, `'something that is much longer but without much other complication'`, `NULL`},
204+
"text not null": {`'foo'`, `'bar'`, `''`, `'something that is much longer but without much other complication'`},
205+
"uuid": {fmt.Sprintf("'%s'", uuid.New().String()), fmt.Sprintf("'%s'", uuid.New().String()), "NULL"},
206+
`character varying(64)`: {`'more string stuff'`, "NULL"},
207+
208+
"jsonb": {`'{}'`, `'{"foo": ["bar", "baz"]}'`, `'{"foo": "bar"}'`, `'{"foo": "bar", "baz": "qux"}'`, `'{"for sure?": true, "has numbers": 123.456, "this is": ["some", "json", "blob"]}'`, "NULL"},
209+
"json": {`'{}'`, `'{"foo": ["bar", "baz"]}'`, `'{"foo": "bar"}'`, `'{"foo": "bar", "baz": "qux"}'`, `'{"for sure?": true, "has numbers": 123.456, "this is": ["some", "json", "blob"]}'`, "NULL"},
210+
211+
"date": {`'2020-12-31'`, "NULL"},
212+
"date not null": {`'2020-12-31'`},
213+
"timestamp with time zone": {`'2020-12-31 23:59:59 -8:00'`, `'2022-06-08 20:03:06.957223+00'`, "NULL"}, // hashes differently for psql/crdb, convert to epoch when hashing
214+
"timestamp without time zone": {`'2020-12-31 23:59:59'`, "NULL"},
213215
}
214216
keys := make([]string, len(columnTypes))
215217
keysWithTypes := make([]string, len(columnTypes))

0 commit comments

Comments
 (0)