Skip to content

Commit

Permalink
refactor: remove raw #s that are unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal committed Dec 11, 2024
1 parent 4e6c61c commit 149016f
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 58 deletions.
4 changes: 2 additions & 2 deletions integration-tests/tests/integration/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1306,10 +1306,10 @@ fn test_show_config_version() {
.open(config_path)
.unwrap();
f.write_all(
r#"
r"
[test-groups.invalid-group]
max-threads = { foo = 42 }
"#
"
.as_bytes(),
)
.unwrap();
Expand Down
6 changes: 3 additions & 3 deletions nextest-runner/src/config/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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#"
Expand All @@ -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#"
Expand All @@ -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#"
Expand Down
4 changes: 2 additions & 2 deletions nextest-runner/src/config/config_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ mod tests {
ignored3 = 42
"#;

let tool_config_contents = r#"
let tool_config_contents = r"
[store]
ignored4 = 20
Expand All @@ -1068,7 +1068,7 @@ mod tests {
filter = 'test(test_baz)'
retries = 22
ignored6 = 6.5
"#;
";

let workspace_dir = tempdir().unwrap();

Expand Down
4 changes: 2 additions & 2 deletions nextest-runner/src/config/nextest_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ mod tests {
}

#[test_case(
r#"
r"
nextest-version = 42
"#,
",
"a table ({{ required = \"0.9.20\", recommended = \"0.9.30\" }}) or a string (\"0.9.50\")" ; "empty"
)]
#[test_case(
Expand Down
12 changes: 6 additions & 6 deletions nextest-runner/src/config/overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,10 +1029,10 @@ mod tests {
}

#[test_case(
indoc! {r#"
indoc! {r"
[[profile.default.overrides]]
retries = 2
"#},
"},
"default",
&[MietteJsonReport {
message: "at least one of `platform` and `filter` must be specified".to_owned(),
Expand Down Expand Up @@ -1087,11 +1087,11 @@ mod tests {
; "both filter and default-filter specified with platform"
)]
#[test_case(
indoc! {r#"
indoc! {r"
[[profile.default.overrides]]
platform = {}
retries = 2
"#},
"},
"default",
&[MietteJsonReport {
message: "at least one of `platform` and `filter` must be specified".to_owned(),
Expand All @@ -1117,11 +1117,11 @@ mod tests {
; "invalid platform expression"
)]
#[test_case(
indoc! {r#"
indoc! {r"
[[profile.ci.overrides]]
filter = 'test(/foo)'
retries = 2
"#},
"},
"ci",
&[MietteJsonReport {
message: "expected close regex".to_owned(),
Expand Down
10 changes: 5 additions & 5 deletions nextest-runner/src/config/scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,18 +753,18 @@ mod tests {
; "empty command"
)]
#[test_case(
indoc! {r#"
indoc! {r"
[script.foo]
command = []
"#},
"},
"invalid length 0, expected a Unix shell command or a list of arguments"
; "empty command list"
)]
#[test_case(
indoc! {r#"
indoc! {r"
[script.foo]
"#},
"},
"script.foo: missing field `command`"
; "missing command"
Expand Down Expand Up @@ -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"
)]
Expand Down
20 changes: 10 additions & 10 deletions nextest-runner/src/config/test_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ mod tests {
Ok(btreeset! {custom_test_group("user-group"), custom_test_group("@tool:my-tool:foo")})
; "group name valid")]
#[test_case(
indoc!{r#"
indoc!{r"
[test-groups.foo]
max-threads = 1
"#},
"},
Err(GroupExpectedError::InvalidTestGroups(btreeset! {custom_test_group("foo")}))
; "group name doesn't start with @tool:")]
#[test_case(
Expand All @@ -168,17 +168,17 @@ mod tests {
Err(GroupExpectedError::DeserializeError("test-groups.@tool:my-tool: invalid custom test group name: tool identifier not of the form \"@tool:tool-name:identifier\": `@tool:my-tool`"))
; "group name missing suffix colon")]
#[test_case(
indoc!{r#"
indoc!{r"
[test-groups.'@global']
max-threads = 1
"#},
"},
Err(GroupExpectedError::DeserializeError("test-groups.@global: invalid custom test group name: invalid identifier `@global`"))
; "group name is @global")]
#[test_case(
indoc!{r#"
indoc!{r"
[test-groups.'@foo']
max-threads = 1
"#},
"},
Err(GroupExpectedError::DeserializeError("test-groups.@foo: invalid custom test group name: invalid identifier `@foo`"))
; "group name starts with @")]
fn tool_config_define_groups(
Expand Down Expand Up @@ -272,17 +272,17 @@ mod tests {
Err(GroupExpectedError::DeserializeError("test-groups.@tool:: invalid custom test group name: tool identifier not of the form \"@tool:tool-name:identifier\": `@tool:`"))
; "group name starts with @tool:")]
#[test_case(
indoc!{r#"
indoc!{r"
[test-groups.'@global']
max-threads = 1
"#},
"},
Err(GroupExpectedError::DeserializeError("test-groups.@global: invalid custom test group name: invalid identifier `@global`"))
; "group name is @global")]
#[test_case(
indoc!{r#"
indoc!{r"
[test-groups.'@foo']
max-threads = 1
"#},
"},
Err(GroupExpectedError::DeserializeError("test-groups.@foo: invalid custom test group name: invalid identifier `@foo`"))
; "group name starts with @")]
fn user_config_define_groups(
Expand Down
12 changes: 6 additions & 6 deletions nextest-runner/src/config/test_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,28 @@ mod tests {
use test_case::test_case;

#[test_case(
indoc! {r#"
indoc! {r"
[profile.custom]
test-threads = -1
"#},
"},
Some(get_num_cpus() - 1)
; "negative"
)]
#[test_case(
indoc! {r#"
indoc! {r"
[profile.custom]
test-threads = 2
"#},
"},
Some(2)
; "positive"
)]
#[test_case(
indoc! {r#"
indoc! {r"
[profile.custom]
test-threads = 0
"#},
"},
None
; "zero"
Expand Down
12 changes: 6 additions & 6 deletions nextest-runner/src/config/threads_required.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,28 @@ mod tests {
use test_case::test_case;

#[test_case(
indoc! {r#"
indoc! {r"
[profile.custom]
threads-required = 2
"#},
"},
Some(2)
; "positive"
)]
#[test_case(
indoc! {r#"
indoc! {r"
[profile.custom]
threads-required = 0
"#},
"},
None
; "zero"
)]
#[test_case(
indoc! {r#"
indoc! {r"
[profile.custom]
threads-required = -1
"#},
"},
None
; "negative"
Expand Down
4 changes: 2 additions & 2 deletions nextest-runner/src/list/binary_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
24 changes: 12 additions & 12 deletions nextest-runner/src/reporter/error_description.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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",
),
];

Expand Down
4 changes: 2 additions & 2 deletions nextest-runner/src/reporter/structured/libtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
];
Expand Down

0 comments on commit 149016f

Please sign in to comment.