From 2d4a68aeb52c3c729694613490e3b534b0a2cac2 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:11:51 +0000 Subject: [PATCH 1/2] test: Add integration test for main.rs run loop Added `test_db_help_argument` in `tests/main.rs` to verify that executing the binary using `--db mock.db help` correctly executes the run loop branch for `help` and prints the expected command instructions. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com> --- tests/main.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/main.rs b/tests/main.rs index b6dbe3d..569c86e 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -31,6 +31,19 @@ fn test_help_argument() { } } +#[test] +fn test_db_help_argument() { + let output = Command::new(get_binary_path()) + .args(["--db", "mock.db", "help"]) + .output() + .expect("Failed to execute command"); + + assert!(output.status.success()); + let stdout = String::from_utf8(output.stdout).unwrap(); + assert!(stdout.contains("zkr --db PATH COMMAND")); + assert!(stdout.contains("Commands")); +} + #[test] fn test_invalid_arguments_error() { let output = Command::new(get_binary_path()) From e0f2aecdd299716192106633f97a844967d79670 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:16:20 +0000 Subject: [PATCH 2/2] test: Add integration test for main.rs run loop and fix formatting Added `test_db_help_argument` in `tests/main.rs` to verify that executing the binary using `--db mock.db help` correctly executes the run loop branch for `help` and prints the expected command instructions. Also fixed Rust formatting in `src/store/schema.rs` and Prettier formatting in `plugins/openclaw/cli.ts` which were causing CI suite failures. 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};