Skip to content

Commit f660dcb

Browse files
committed
Incorporate patch to build ntest with 1.68, add unused_variables integration test, make error message grammer more clean
1 parent 092a35c commit f660dcb

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

serial_test_derive/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,15 @@ fn get_config(attr: proc_macro2::TokenStream) -> Config {
387387
match attrs.remove(0) {
388388
TokenTree::Punct(p) if p.as_char() == '=' => {}
389389
x => {
390-
panic!("Expected = after inner_attrs, not {}", x);
390+
panic!("Expected '=' after 'inner_attrs' not {}", x);
391391
}
392392
}
393393
match attrs.remove(0) {
394394
TokenTree::Group(group) if group.delimiter() == proc_macro2::Delimiter::Bracket => {
395395
inner_attrs = parse_inner_attrs_from_group(group);
396396
}
397397
x => {
398-
panic!("Expected [...] after inner_attrs =, not {}", x);
398+
panic!("Expected [...] after 'inner_attrs =' not {}", x);
399399
}
400400
}
401401
in_inner_attrs = false;
@@ -404,7 +404,7 @@ fn get_config(attr: proc_macro2::TokenStream) -> Config {
404404
match attrs.remove(0) {
405405
TokenTree::Punct(p) if p.as_char() == ',' => {}
406406
x => {
407-
panic!("Expected , between args, not {}", x);
407+
panic!("Expected ',' between args not {}", x);
408408
}
409409
}
410410
}

serial_test_test/tests/inner_attrs.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Tests for the inner_attrs feature with ntest::timeout
1+
//! Tests for the inner_attrs feature with ntest::timeout and std attributes
22
33
use serial_test::{parallel, serial};
44

@@ -37,3 +37,10 @@ fn test_serial_with_multiple_inner_attrs() {
3737
fn test_serial_inner_timeout_panics() {
3838
std::thread::sleep(std::time::Duration::from_secs(1));
3939
}
40+
41+
/// Test with allow attribute
42+
#[test]
43+
#[serial(inner_attrs = [allow(unused_variables)])]
44+
fn test_serial_with_inner_allow() {
45+
let _unused = 42;
46+
}

0 commit comments

Comments
 (0)