Skip to content

Commit 0844bc6

Browse files
senekoryjhtry
andauthored
macros: fix invalid file paths (#2042)
This regression was introduced in: 88c13fb [no important files changed] Co-authored-by: yjhtry <[email protected]>
1 parent c8dd241 commit 0844bc6

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

exercises/practice/macros/tests/invalid/Cargo.toml

+20-20
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,41 @@ path = "../../"
1515
default-features = false
1616

1717
[[bin]]
18-
name = "comma-sep-rs"
19-
path = "comma-sep.rs"
18+
name = "comma_sep"
19+
path = "comma_sep.rs"
2020

2121
[[bin]]
22-
name = "double-commas-rs"
23-
path = "double-commas.rs"
22+
name = "double_commas"
23+
path = "double_commas.rs"
2424

2525
[[bin]]
26-
name = "only-arrow-rs"
27-
path = "only-arrow.rs"
26+
name = "only_arrow"
27+
path = "only_arrow.rs"
2828

2929
[[bin]]
30-
name = "only-comma-rs"
31-
path = "only-comma.rs"
30+
name = "only_comma"
31+
path = "only_comma.rs"
3232

3333
[[bin]]
34-
name = "single-argument-rs"
35-
path = "single-argument.rs"
34+
name = "single_argument"
35+
path = "single_argument.rs"
3636

3737
[[bin]]
38-
name = "triple-arguments-rs"
39-
path = "triple-arguments.rs"
38+
name = "triple_arguments"
39+
path = "triple_arguments.rs"
4040

4141
[[bin]]
42-
name = "two-arrows-rs"
43-
path = "two-arrows.rs"
42+
name = "two_arrows"
43+
path = "two_arrows.rs"
4444

4545
[[bin]]
46-
name = "leading-comma-rs"
47-
path = "leading-comma.rs"
46+
name = "leading_comma"
47+
path = "leading_comma.rs"
4848

4949
[[bin]]
50-
name = "no-comma-rs"
51-
path = "no-comma.rs"
50+
name = "no_comma"
51+
path = "no_comma.rs"
5252

5353
[[bin]]
54-
name = "missing-argument-rs"
55-
path = "missing-argument.rs"
54+
name = "missing_argument"
55+
path = "missing_argument.rs"

exercises/practice/macros/tests/macros.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -117,61 +117,61 @@ fn type_override() {
117117
#[test]
118118
#[ignore]
119119
fn compile_fails_comma_sep() {
120-
simple_trybuild::compile_fail("comma-sep.rs");
120+
simple_trybuild::compile_fail("comma_sep.rs");
121121
}
122122

123123
#[test]
124124
#[ignore]
125125
fn compile_fails_double_commas() {
126-
simple_trybuild::compile_fail("double-commas.rs");
126+
simple_trybuild::compile_fail("double_commas.rs");
127127
}
128128

129129
#[test]
130130
#[ignore]
131131
fn compile_fails_only_comma() {
132-
simple_trybuild::compile_fail("only-comma.rs");
132+
simple_trybuild::compile_fail("only_comma.rs");
133133
}
134134

135135
#[test]
136136
#[ignore]
137137
fn compile_fails_single_argument() {
138-
simple_trybuild::compile_fail("single-argument.rs");
138+
simple_trybuild::compile_fail("single_argument.rs");
139139
}
140140

141141
#[test]
142142
#[ignore]
143143
fn compile_fails_triple_arguments() {
144-
simple_trybuild::compile_fail("triple-arguments.rs");
144+
simple_trybuild::compile_fail("triple_arguments.rs");
145145
}
146146

147147
#[test]
148148
#[ignore]
149149
fn compile_fails_only_arrow() {
150-
simple_trybuild::compile_fail("only-arrow.rs");
150+
simple_trybuild::compile_fail("only_arrow.rs");
151151
}
152152

153153
#[test]
154154
#[ignore]
155155
fn compile_fails_two_arrows() {
156-
simple_trybuild::compile_fail("two-arrows.rs");
156+
simple_trybuild::compile_fail("two_arrows.rs");
157157
}
158158

159159
#[test]
160160
#[ignore]
161161
fn compile_fails_leading_comma() {
162-
simple_trybuild::compile_fail("leading-comma.rs");
162+
simple_trybuild::compile_fail("leading_comma.rs");
163163
}
164164

165165
#[test]
166166
#[ignore]
167167
fn compile_fails_no_comma() {
168-
simple_trybuild::compile_fail("no-comma.rs");
168+
simple_trybuild::compile_fail("no_comma.rs");
169169
}
170170

171171
#[test]
172172
#[ignore]
173173
fn compile_fails_missing_argument() {
174-
simple_trybuild::compile_fail("missing-argument.rs");
174+
simple_trybuild::compile_fail("missing_argument.rs");
175175
}
176176

177177
mod simple_trybuild {
@@ -189,7 +189,7 @@ mod simple_trybuild {
189189
file_path.into_os_string()
190190
);
191191

192-
let test_name = file_name.replace('.', "-");
192+
let test_name = file_name.strip_suffix(".rs").unwrap();
193193
let macros_dir = ["..", "..", "target", "tests", "macros"]
194194
.iter()
195195
.collect::<PathBuf>();

0 commit comments

Comments
 (0)