Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chdsbd committed Oct 9, 2024
1 parent 12aa7b6 commit e324399
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## v1.4.1

### Fixed

- fix `start transaction` support (#386). Thanks @bmbferreira!

## v1.4.0 - 2024-09-24

### Added
Expand Down
17 changes: 17 additions & 0 deletions linter/src/rules/prefer_robust_stmts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,23 @@ ALTER TABLE IF EXISTS test DISABLE ROW LEVEL SECURITY;
);
}

#[test]
fn test_start_transaction() {
let sql = r#"
START TRANSACTION;
ALTER TABLE "A" DROP CONSTRAINT "UQ_c4fb579a038211909ee524ccf29";
ALTER TABLE "B" DROP CONSTRAINT "UQ_791c01fe9438d66a94490d0da28";
ALTER TABLE "C" DROP CONSTRAINT "UQ_23fbf20e8ab4e806941359f4f79";
ALTER TABLE "D" DROP CONSTRAINT "UQ_468cad3743146a81c94b0b114ac";
COMMIT;"#;
assert_eq!(lint_sql(sql), Ok(vec![]));
}

#[test]
fn test_prefer_robust_stmt_failure_cases() {
let sql = r#"
Expand Down

0 comments on commit e324399

Please sign in to comment.