v0.3.3-pre.009-fix.005

This commit is contained in:
2026-08-30 15:46:03 +02:00
parent 5f1938c7c3
commit ba2e52f841
5 changed files with 183 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-store-postgres-lib/unit_tests/schema.rs
// version: 3
// version: 4
fn actual_column(name: &str, udt_name: &str, nullable: bool) -> super::ActualColumn {
return super::ActualColumn {
@@ -101,6 +101,19 @@ fn pre_003_fix_001_catalog_normalization_and_resource_owned_constraint_definitio
assert_eq!(normalized, "checkslot>=0andslot<=18446744073709551615");
let postgres_17_normalized = super::normalize_catalog_sql("CHECK ((slot >= '0'::numeric) AND (slot <= '18446744073709551615'::numeric))");
assert_eq!(postgres_17_normalized, normalized);
let bigint_normalized = super::normalize_catalog_sql(
"CHECK ((block_time_unix_millis IS NULL) OR ((block_time_unix_millis >= '0'::bigint) AND (block_time_unix_millis <= '253402300799999'::bigint)))",
);
let block_time_resource = crate::V001_RESOURCES.iter().find(|resource| return resource.id == "constraints/007_ck_ksp_raw_transactions_block_time.sql");
assert!(block_time_resource.is_some(), "V001 block-time constraint resource must remain embedded");
let block_time_resource = match block_time_resource {
std::option::Option::Some(value) => value,
std::option::Option::None => return,
};
let block_time_expected = super::expected_constraint_definition(block_time_resource.sql, "ck_ksp_raw_transactions_block_time");
assert_eq!(block_time_expected.as_deref(), std::option::Option::Some(bigint_normalized.as_str()));
let integer_alias = super::normalize_catalog_sql("CHECK (format_version <= '4294967295'::int8)");
assert_eq!(integer_alias, "checkformat_version<=4294967295");
let text_literal = super::normalize_catalog_sql("CHECK (retention_state = 'full'::text)");
assert_eq!(text_literal, "checkretention_state='full'");
let resource = crate::V001_RESOURCES.iter().find(|resource| return resource.id == "constraints/006_ck_ksp_raw_transactions_slot.sql");