Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
darrell-roberts committed Aug 8, 2024
1 parent 4782037 commit 53291ea
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/src/target_os_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,16 @@ mod test {

assert!(accept_target_os(&test_struct.attrs, &["android".into()]))
}

#[test]
fn test_not_scope_reverse() {
init_log();

let test_struct: ItemStruct = parse_quote! {
#[cfg(all(target_os = "android", not(feature = "my-feature")))]
pub struct Test;
};

assert!(accept_target_os(&test_struct.attrs, &["android".into()]))
}
}

0 comments on commit 53291ea

Please sign in to comment.