0.0.4-alpha.2
This commit is contained in:
23
crates/knowledge-store-postgres-lib/unit_tests/config.rs
Normal file
23
crates/knowledge-store-postgres-lib/unit_tests/config.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
// file: crates/knowledge-store-postgres-lib/unit_tests/config.rs
|
||||
// version: 1
|
||||
|
||||
#[test]
|
||||
fn config_rejects_empty_database_url() {
|
||||
let result = crate::PostgresStoreConfig::new(" ", 4);
|
||||
assert!(matches!(result, Err(crate::PostgresStoreError::EmptyDatabaseUrl)));
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn config_rejects_zero_pool_size() {
|
||||
let result = crate::PostgresStoreConfig::new("postgresql://localhost/knowledge", 0);
|
||||
assert!(matches!(result, Err(crate::PostgresStoreError::InvalidPoolSize)));
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn config_accepts_explicit_non_empty_values() {
|
||||
let result = crate::PostgresStoreConfig::new("postgresql://localhost/knowledge", 4);
|
||||
assert!(result.is_ok());
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user