Skip to content

Commit 0070202

Browse files
authored
fix printf macos + rg (#403)
1 parent 15e417d commit 0070202

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ci/check_all_exposed_funs_tested.roc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ err_s = |err_msg| Err(StrErr(err_msg))
1919

2020
main! : List Arg => Result {} _
2121
main! = |_args|
22+
# Check if ripgrep is installed
23+
_ = Cmd.exec!("rg", ["--version"]) ? |err| RipgrepNotInstalled(err)
24+
2225
cwd = Env.cwd!({}) ? |err| FailedToGetCwd(err)
2326
Stdout.line!("Current working directory: ${Path.display(cwd)}")?
2427

@@ -105,9 +108,6 @@ is_function_unused! = |module_name, function_name|
105108
err_s("Error checking directory '${search_dir}': ${Inspect.to_str(err)}")
106109
)?
107110

108-
# Check if ripgrep is installed
109-
_ = Cmd.exec!("rg", ["--version"]) ? |err| RipgrepNotInstalled(err)
110-
111111

112112
unused_in_dir =
113113
search_dirs

tests/cmd-test.roc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ main! = |_args|
5151
# Test StdoutContainsInvalidUtf8 - using printf to output invalid UTF-8 bytes
5252
expect_err(
5353
Cmd.new("printf")
54-
|> Cmd.arg("\\xff\\xfe") # Invalid UTF-8 sequence
54+
|> Cmd.args(["%b", "\\xff\\xfe"]) # Invalid UTF-8 sequence
5555
|> Cmd.exec_output!,
56-
"(Err (StdoutContainsInvalidUtf8 {cmd_str: \"{ cmd: printf, args: \\xff\\xfe }\", err: (BadUtf8 {index: 0, problem: InvalidStartByte})}))"
56+
"(Err (StdoutContainsInvalidUtf8 {cmd_str: \"{ cmd: printf, args: %b \\xff\\xfe }\", err: (BadUtf8 {index: 0, problem: InvalidStartByte})}))"
5757
)?
5858

5959
# exec_output_bytes!

0 commit comments

Comments
 (0)