From a33916bf7d1553691925f57920464ad2e4324644 Mon Sep 17 00:00:00 2001 From: Veit Heller Date: Sun, 6 Sep 2026 00:46:38 +0200 Subject: [PATCH] Follow core's rename of format to unsafe-format --- examples.md | 4 ++-- test/process_test.carp | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/examples.md b/examples.md index 3b0d4df..05d5b82 100644 --- a/examples.md +++ b/examples.md @@ -16,8 +16,8 @@ The `Process.run` function is the easiest way to execute a command and capture i (IO.println (Output.stdout &output)) (let [status (Output.status &output)] (if @(ExitStatus.exited? status) - (IO.println &(format "Exited with code: %d" @(ExitStatus.code status))) - (IO.println &(format "Killed by signal: %d" @(ExitStatus.signal status)))))))) + (IO.println &(unsafe-format "Exited with code: %d" @(ExitStatus.code status))) + (IO.println &(unsafe-format "Killed by signal: %d" @(ExitStatus.signal status)))))))) ``` ## Deadlock-Safe Execution diff --git a/test/process_test.carp b/test/process_test.carp index 5dc28ae..94d93f3 100644 --- a/test/process_test.carp +++ b/test/process_test.carp @@ -17,7 +17,7 @@ (Result.Error err) (assert-true process-test-state false - &(format "Failed to spawn 'ls': %s" &err))) + &(unsafe-format "Failed to spawn 'ls': %s" &err))) ;; Test 2: Command & Run (Capture Output) cmd2 (Command.new "echo") cmd-with-args2 (Command.arg cmd2 "hello carp") @@ -48,7 +48,9 @@ @(ExitStatus.code &status) "Custom exit code via 'sh'")) (Result.Error err) - (assert-true &s5 false &(format "Failed to spawn 'sh': %s" &err))) + (assert-true &s5 + false + &(unsafe-format "Failed to spawn 'sh': %s" &err))) ;; Test 5: Deadlock prevention with run-combined (Large output) cmd5 (Command.new "python3") cmd5-args (Command.arg cmd5 "-c") @@ -93,7 +95,9 @@ t1.start(); t2.start(); t1.join(); t2.join()") (not @(ExitStatus.exited? &status)) "Process killed by signal did not exit normally"))) (Result.Error err) - (assert-true &s8 false &(format "Failed to spawn 'sleep': %s" &err))) + (assert-true &s8 + false + &(unsafe-format "Failed to spawn 'sleep': %s" &err))) ;; Test 8: Stdin piping cmd8 (Command.new "cat") cmd8-in (Command.set-stdin cmd8 "carp stdin test")