Bit better bats test

This commit is contained in:
Zach Musgrave
2023-03-14 18:34:32 -07:00
parent bdc296e0f7
commit d384b3cf10
2 changed files with 28 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ import (
type diffWriter interface {
// BeginTable is called when a new table is about to be written, before any schema or row diffs are written
BeginTable(ctx context.Context, td diff.TableDelta) error
// WriteSchemaDiff is called to write a schema diff for the table given (if requested by args)
// WriteTableSchemaDiff is called to write a schema diff for the table given (if requested by args)
WriteTableSchemaDiff(ctx context.Context, toRoot *doltdb.RootValue, td diff.TableDelta) error
// WriteTriggerDiff is called to write a trigger diff
WriteTriggerDiff(ctx context.Context, triggerName, oldDefn, newDefn string) error

View File

@@ -836,4 +836,31 @@ ${output}
EOF
diff -w expected actual
# check alterations of triggers and views
dolt sql <<SQL
drop trigger tr1;
drop view v1;
create trigger tr1 before insert on test for each row set new.c1 = new.c1 + 100;
create view v1 as select "goodbye" from test;
SQL
dolt commit -am "new view and trigger defs"
dolt diff -r sql HEAD~ HEAD
run dolt diff -r sql HEAD~ HEAD
[ "$status" -eq 0 ]
cat > expected <<'EOF'
DROP TRIGGER `tr1`;
create trigger tr1 before insert on test for each row set new.c1 = new.c1 + 100;
DROP VIEW `v1`;
create view v1 as select "goodbye" from test;
EOF
cat > actual <<EOF
${output}
EOF
diff -w expected actual
}