From b4e0fd4a06913f5c2ad946bc4626a6719fcf7592 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 04:12:47 +0000 Subject: [PATCH 1/2] test: add tests for validate_text edge cases in model.rs Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com> --- src/model.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/model.rs b/src/model.rs index d1c9e17..f94d470 100644 --- a/src/model.rs +++ b/src/model.rs @@ -481,4 +481,37 @@ mod tests { _ => panic!("Expected EmptyText error for evidence id"), } } + + #[test] + fn test_validate_text_valid() { + assert_eq!(validate_text("test_field", "valid text"), Ok(())); + assert_eq!(validate_text("test_field", " leading whitespace"), Ok(())); + assert_eq!(validate_text("test_field", "trailing whitespace "), Ok(())); + assert_eq!(validate_text("test_field", " both "), Ok(())); + assert_eq!(validate_text("test_field", "a"), Ok(())); + } + + #[test] + fn test_validate_text_invalid() { + assert_eq!( + validate_text("test_field", ""), + Err(ValidationError::EmptyText("test_field")) + ); + assert_eq!( + validate_text("test_field", " "), + Err(ValidationError::EmptyText("test_field")) + ); + assert_eq!( + validate_text("test_field", "\t"), + Err(ValidationError::EmptyText("test_field")) + ); + assert_eq!( + validate_text("test_field", "\n"), + Err(ValidationError::EmptyText("test_field")) + ); + assert_eq!( + validate_text("test_field", " \t\n "), + Err(ValidationError::EmptyText("test_field")) + ); + } } From 0293736edb85e6eb6b57fd9fb9c77d45fc9c6883 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 04:15:00 +0000 Subject: [PATCH 2/2] chore: fix formatting in rust and typescript Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com> --- plugins/openclaw/cli.ts | 2 +- src/store/schema.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/openclaw/cli.ts b/plugins/openclaw/cli.ts index bd3689f..b909b9e 100644 --- a/plugins/openclaw/cli.ts +++ b/plugins/openclaw/cli.ts @@ -39,7 +39,7 @@ export async function runZkr( input: unknown, options: ZkrOptions = {}, ): Promise { -if (options.command !== undefined && typeof options.command !== "string") { + if (options.command !== undefined && typeof options.command !== "string") { throw new Error("zkr command must be a string"); } if (options.database !== undefined && typeof options.database !== "string") { diff --git a/src/store/schema.rs b/src/store/schema.rs index 1a9e818..007fe7d 100644 --- a/src/store/schema.rs +++ b/src/store/schema.rs @@ -1,6 +1,6 @@ use super::export::{ - append_records, claim_evidence_record, claim_records, evidence_record, - review_record, source_record, + append_records, claim_evidence_record, claim_records, evidence_record, review_record, + source_record, }; use super::*; use rusqlite::{Transaction, TransactionBehavior};