Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: lint-fix
  • Loading branch information
psteinroe committed Apr 4, 2025
commit e258bea675e1fdb75a840ebfaca6726e5cda714a
16 changes: 8 additions & 8 deletions crates/pgt_workspace/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,32 +449,32 @@ mod tests {
#[test]
fn should_identify_allowed_statement_executions() {
let partial_config = PartialDatabaseConfiguration {
allow_statement_executions_against: Some(StringSet::from_iter(
vec![String::from("localhost/*")].into_iter(),
)),
allow_statement_executions_against: Some(StringSet::from_iter(vec![String::from(
"localhost/*",
)])),
host: Some("localhost".into()),
database: Some("test-db".into()),
..Default::default()
};

let config = DatabaseSettings::from(partial_config);

assert_eq!(config.allow_statement_executions, true)
assert!(config.allow_statement_executions)
}

#[test]
fn should_identify_not_allowed_statement_executions() {
let partial_config = PartialDatabaseConfiguration {
allow_statement_executions_against: Some(StringSet::from_iter(
vec![String::from("localhost/*")].into_iter(),
)),
allow_statement_executions_against: Some(StringSet::from_iter(vec![String::from(
"localhost/*",
)])),
host: Some("production".into()),
database: Some("test-db".into()),
..Default::default()
};

let config = DatabaseSettings::from(partial_config);

assert_eq!(config.allow_statement_executions, false)
assert!(!config.allow_statement_executions)
}
}
Loading