From d4c6f9fbeb1ef6cbd9efcb32480f64051f09bf50 Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Fri, 13 Dec 2024 12:30:54 -0800 Subject: [PATCH] refactor: remove raw #s that are unnecessary --- nextest-runner/src/config/archive.rs | 6 ++--- nextest-runner/src/config/scripts.rs | 2 +- nextest-runner/src/list/binary_list.rs | 4 ++-- .../src/reporter/error_description.rs | 24 +++++++++---------- .../src/reporter/structured/libtest.rs | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/nextest-runner/src/config/archive.rs b/nextest-runner/src/config/archive.rs index 3ec95749384..641fc5df9d3 100644 --- a/nextest-runner/src/config/archive.rs +++ b/nextest-runner/src/config/archive.rs @@ -353,7 +353,7 @@ mod tests { [profile.default] archive.include = { path = "foo", relative-to = "target" } "#}, - r#"invalid type: map, expected a sequence"# + r"invalid type: map, expected a sequence" ; "missing list")] #[test_case( indoc!{r#" @@ -362,7 +362,7 @@ mod tests { { path = "foo" } ] "#}, - r#"missing field `relative-to`"# + r"missing field `relative-to`" ; "missing relative-to")] #[test_case( indoc!{r#" @@ -371,7 +371,7 @@ mod tests { { path = "bar", relative-to = "unknown" } ] "#}, - r#"enum ArchiveRelativeTo does not have variant constructor unknown"# + r"enum ArchiveRelativeTo does not have variant constructor unknown" ; "invalid relative-to")] #[test_case( indoc!{r#" diff --git a/nextest-runner/src/config/scripts.rs b/nextest-runner/src/config/scripts.rs index 5e0af0682d0..5911524592b 100644 --- a/nextest-runner/src/config/scripts.rs +++ b/nextest-runner/src/config/scripts.rs @@ -793,7 +793,7 @@ mod tests { [script.'#foo'] command = "my-command" "#}, - r#"invalid configuration script name: invalid identifier `#foo`"# + r"invalid configuration script name: invalid identifier `#foo`" ; "invalid script name" )] diff --git a/nextest-runner/src/list/binary_list.rs b/nextest-runner/src/list/binary_list.rs index 02af1459e9e..c40691034c2 100644 --- a/nextest-runner/src/list/binary_list.rs +++ b/nextest-runner/src/list/binary_list.rs @@ -520,14 +520,14 @@ mod tests { fake-package::bin/fake-binary fake-macro::proc-macro/fake-macro "}; - static EXPECTED_HUMAN_VERBOSE: &str = indoc! {r#" + static EXPECTED_HUMAN_VERBOSE: &str = indoc! {r" fake-package::bin/fake-binary: bin: /fake/binary build platform: target fake-macro::proc-macro/fake-macro: bin: /fake/macro build platform: host - "#}; + "}; static EXPECTED_JSON_PRETTY: &str = indoc! {r#" { "rust-build-meta": { diff --git a/nextest-runner/src/reporter/error_description.rs b/nextest-runner/src/reporter/error_description.rs index 90a0699c112..640b6b7ffd8 100644 --- a/nextest-runner/src/reporter/error_description.rs +++ b/nextest-runner/src/reporter/error_description.rs @@ -440,17 +440,17 @@ more text at the end, followed by some newlines"#, ), // Multiple panics: only the last one should be extracted. ( - r#" + r" thread 'main' panicked at src/lib.rs:1: foo thread 'main' panicked at src/lib.rs:2: bar -"#, - r#"thread 'main' panicked at src/lib.rs:2: -bar"#, +", + r"thread 'main' panicked at src/lib.rs:2: +bar", ), // With RUST_BACKTRACE=1 ( - r#" + r" some initial text line 2 line 3 @@ -473,8 +473,8 @@ note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose bac more text at the end, followed by some newlines -"#, - r#"thread 'reporter::helpers::tests::test_heuristic_stack_trace' panicked at nextest-runner/src/reporter/helpers.rs:237:9: +", + r"thread 'reporter::helpers::tests::test_heuristic_stack_trace' panicked at nextest-runner/src/reporter/helpers.rs:237:9: test stack backtrace: 0: rust_begin_unwind @@ -490,11 +490,11 @@ stack backtrace: 5: core::ops::function::FnOnce::call_once at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/ops/function.rs:250:5 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. -more text at the end, followed by some newlines"#, +more text at the end, followed by some newlines", ), // RUST_BACKTRACE=full ( - r#" + r" some initial text thread 'reporter::helpers::tests::test_heuristic_stack_trace' panicked at nextest-runner/src/reporter/helpers.rs:237:9: test @@ -514,8 +514,8 @@ stack backtrace: some more text at the end, followed by some newlines -"#, - r#"thread 'reporter::helpers::tests::test_heuristic_stack_trace' panicked at nextest-runner/src/reporter/helpers.rs:237:9: +", + r"thread 'reporter::helpers::tests::test_heuristic_stack_trace' panicked at nextest-runner/src/reporter/helpers.rs:237:9: test stack backtrace: 0: 0x61e6da135fe5 - std::backtrace_rs::backtrace::libunwind::trace::h23054e327d0d4b55 @@ -530,7 +530,7 @@ stack backtrace: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/rt.rs:165:63 5: 0x61e6da16433b - core::fmt::write::hc6043626647b98ea at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/mod.rs:1168:21 -some more text at the end, followed by some newlines"#, +some more text at the end, followed by some newlines", ), ]; diff --git a/nextest-runner/src/reporter/structured/libtest.rs b/nextest-runner/src/reporter/structured/libtest.rs index 0dbfb91d496..d6a2e5bd777 100644 --- a/nextest-runner/src/reporter/structured/libtest.rs +++ b/nextest-runner/src/reporter/structured/libtest.rs @@ -685,7 +685,7 @@ mod test { "this is stdout\n", "this i stderr\nok?\n", "thread 'index::test::download_url_crates_io'", - r#" panicked at src/index.rs:206:9: + r" panicked at src/index.rs:206:9: oh no stack backtrace: 0: rust_begin_unwind @@ -701,7 +701,7 @@ stack backtrace: 5: core::ops::function::FnOnce::call_once at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/ops/function.rs:250:5 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. -"#, +", "test index::test::download_url_crates_io ... FAILED\n", "\n\nfailures:\n\nfailures:\n index::test::download_url_crates_io\n\ntest result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.01s\n", ];