Skip to content

Commit

Permalink
internal: tweak test case to fix lastest core
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Jul 19, 2024
1 parent 058aaca commit c05c4da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions crates/moon/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub fn moon_bin() -> PathBuf {
snapbox::cmd::cargo_bin("moon")
}

#[track_caller]
pub fn get_stdout_with_args_without_replace(
dir: &impl AsRef<std::path::Path>,
args: impl IntoIterator<Item = impl AsRef<std::ffi::OsStr>>,
Expand Down Expand Up @@ -94,6 +95,7 @@ pub fn get_stderr_with_args_without_replace(
s
}

#[track_caller]
pub fn get_stdout_with_args(
dir: &impl AsRef<std::path::Path>,
args: impl IntoIterator<Item = impl AsRef<std::ffi::OsStr>>,
Expand Down Expand Up @@ -123,6 +125,7 @@ pub fn replace_dir(s: &str, dir: &impl AsRef<std::path::Path>) -> String {
s.replace("\r\n", "\n").replace('\\', "/")
}

#[track_caller]
pub fn get_stdout_with_args_and_replace_dir(
dir: &impl AsRef<std::path::Path>,
args: impl IntoIterator<Item = impl AsRef<std::ffi::OsStr>>,
Expand Down
4 changes: 2 additions & 2 deletions crates/moon/tests/test_cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ fn test_expect_test() -> anyhow::Result<()> {
assert!(out.contains("Total tests: 30, passed: 30, failed: 0."));
let updated =
std::fs::read_to_string(tmp_dir_path.as_ref().join("lib").join("hello.mbt")).unwrap();
assert!(updated.contains(r#"[a, b, c]"#));
assert!(updated.contains(r#"["a", "b", "c"]"#));

let s = snapbox::cmd::Command::new(moon_bin())
.current_dir(&tmp_dir_path)
Expand Down Expand Up @@ -4189,7 +4189,7 @@ fn test_moon_run_with_cli_args() {
["run", "main", "--", "中文", "😄👍", "hello", "1242"],
),
expect![[r#"
[中文, 😄👍, hello, 1242]
["中文", "😄👍", "hello", "1242"]
"#]],
);
}
Expand Down

0 comments on commit c05c4da

Please sign in to comment.