Skip to content

Commit eea16b0

Browse files
committed
Add a few more test cases
1 parent c65c792 commit eea16b0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

fearless_simd_core/src/support.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ mod tests {
199199
expect_failure("c,a,b", [&["a", "b"]], "c");
200200
expect_success("a,b", [&["a", "b", "c"]]);
201201
expect_failure("a,b", [&["a", "c"]], "b");
202+
expect_success("a,b,a,a", [&["a", "b", "c"]]);
203+
expect_success("a,b,c", [&["c"], &["b"], &["a"]]);
202204

203205
// Check it correctly catches more than single item failures
204206
expect_success("a1,a2,a3", [&["a1", "a2", "a3"]]);
@@ -220,10 +222,23 @@ mod tests {
220222
expect_failure("a1b,a2b", [&["a1b", "a3b"]], "a2b");
221223
}
222224

225+
#[test]
226+
fn incorrect_token() {
227+
// The permitted list here only allows features which are the literal `a1,a2`
228+
// This is completely impossible to pass, but it's worth checking
229+
expect_any_failure("a1,a2", [&["a1,a2"]]);
230+
}
231+
223232
#[test]
224233
fn empty_feature() {
225234
expect_failure("a,b,", [&["a", "b"]], "");
226235
expect_failure("", [&["a", "b"]], "");
236+
237+
// We succeed if the empty target feature is allowed; any case where this is relevant will always
238+
// be validated away by rustc anyway, as there is no target with the target feature `""`.
239+
// As such, there's no harm in being flexible here.
240+
expect_success("", [&[""]]);
241+
expect_success(",,,,,,", [&[""]]);
227242
}
228243

229244
#[test]

0 commit comments

Comments
 (0)