From bb0f29ee79a8288f3ede5f4ea50c302620cc3dfd Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Thu, 16 Jun 2022 12:33:24 -0700 Subject: [PATCH] Fixed test for schema-only diff --- integration-tests/bats/diff.bats | 36 +++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/integration-tests/bats/diff.bats b/integration-tests/bats/diff.bats index d3975a8d54..753a6d0397 100644 --- a/integration-tests/bats/diff.bats +++ b/integration-tests/bats/diff.bats @@ -79,7 +79,7 @@ teardown() { dolt diff run dolt diff [ "$status" -eq 0 ] - [[ ! "$output" =~ "CREATE TABLE" ]] + [[ ! "$output" =~ "CREATE TABLE" ]] || false [[ "$output" =~ "| | pk | c1 | c2 | c3 | c4 | c5 |" ]] || false [[ "$output" =~ "| + | 10 | NULL | NULL | NULL | NULL | NULL |" ]] || false } @@ -87,18 +87,38 @@ teardown() { @test "diff: schema diff only" { dolt commit -am "First commit" - dolt sql -q "alter table test drop column c1" + dolt sql -q < | pk | c2 | c3 | c4 | c5 | |" ]] || false -} + [[ "$output" =~ "$EXPECTED" ]] || false + + # We want to make sure there is no trailing table output, so count the lines of output + # 3 lines of metadata plus 11 of schema diff + [ "${#lines[@]}" -eq 14 ] + } @test "diff: with table args" { dolt sql -q 'create table other (pk int not null primary key)'