Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Oct 17, 2023
1 parent 3002ec7 commit 9464cd1
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions nexus/tests/integration_tests/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,3 +1016,44 @@ async fn compare_table_differing_constraint() {
assert_ne!(schema1.check_constraints, schema2.check_constraints);
logctx.cleanup_successful();
}

#[tokio::test]
async fn compare_table_differing_not_null_order() {
let config = load_test_config();
let logctx = LogContext::new(
"compare_table_differing_not_null_order",
&config.pkg.log,
);
let log = &logctx.log;

let schema1 = get_information_schema(
log,
"
CREATE DATABASE omicron;
CREATE TABLE omicron.public.pet ( id UUID PRIMARY KEY );
CREATE TABLE omicron.public.employee (
id UUID PRIMARY KEY,
name TEXT NOT NULL,
hobbies TEXT
);
",
)
.await;

let schema2 = get_information_schema(
log,
"
CREATE DATABASE omicron;
CREATE TABLE omicron.public.employee (
id UUID PRIMARY KEY,
name TEXT NOT NULL,
hobbies TEXT
);
CREATE TABLE omicron.public.pet ( id UUID PRIMARY KEY );
",
)
.await;

schema1.pretty_assert_eq(&schema2);
logctx.cleanup_successful();
}

0 comments on commit 9464cd1

Please sign in to comment.