Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use fully qualified names in wasm_bindgen_test for items exported from std prelude #3549

Merged
merged 3 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/test-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ pub fn wasm_bindgen_test(
let mut tokens = Vec::<TokenTree>::new();

let should_panic = match should_panic {
Some(Some(lit)) => quote! { Some(Some(#lit)) },
Some(None) => quote! { Some(None) },
None => quote! { None },
Some(Some(lit)) => {
quote! { ::core::option::Option::Some(::core::option::Option::Some(#lit)) }
}
Some(None) => quote! { ::core::option::Option::Some(::core::option::Option::None) },
None => quote! { ::core::option::Option::None },
};

let test_body = if r#async {
Expand Down
4 changes: 4 additions & 0 deletions crates/test-macro/ui-tests/should_panic.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#![no_implicit_prelude]

extern crate wasm_bindgen_test_macro;

use wasm_bindgen_test_macro::wasm_bindgen_test;

#[wasm_bindgen_test]
Expand Down
40 changes: 20 additions & 20 deletions crates/test-macro/ui-tests/should_panic.stderr
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
error: malformed `#[should_panic = "..."]` attribute
--> ui-tests/should_panic.rs:28:15
--> ui-tests/should_panic.rs:32:15
|
28 | #[should_panic::error]
32 | #[should_panic::error]
| ^

error: malformed `#[should_panic]` attribute
--> ui-tests/should_panic.rs:32:18
--> ui-tests/should_panic.rs:36:18
|
32 | #[should_panic = 42]
36 | #[should_panic = 42]
| ^^

error: malformed `#[should_panic = "..."]` attribute
--> ui-tests/should_panic.rs:36:15
--> ui-tests/should_panic.rs:40:15
|
36 | #[should_panic[]]
40 | #[should_panic[]]
| ^^

error: malformed `#[should_panic(...)]` attribute
--> ui-tests/should_panic.rs:40:15
--> ui-tests/should_panic.rs:44:15
|
40 | #[should_panic(42)]
44 | #[should_panic(42)]
| ^^^^

error: malformed `#[should_panic(...)]` attribute
--> ui-tests/should_panic.rs:44:15
--> ui-tests/should_panic.rs:48:15
|
44 | #[should_panic(test)]
48 | #[should_panic(test)]
| ^^^^^^

error: malformed `#[should_panic(...)]` attribute
--> ui-tests/should_panic.rs:48:15
--> ui-tests/should_panic.rs:52:15
|
48 | #[should_panic(expected)]
52 | #[should_panic(expected)]
| ^^^^^^^^^^

error: malformed `#[should_panic(...)]` attribute
--> ui-tests/should_panic.rs:52:15
--> ui-tests/should_panic.rs:56:15
|
52 | #[should_panic(expected::error)]
56 | #[should_panic(expected::error)]
| ^^^^^^^^^^^^^^^^^

error: malformed `#[should_panic]` attribute
--> ui-tests/should_panic.rs:56:3
--> ui-tests/should_panic.rs:60:3
|
56 | #[should_panic(expected =)]
60 | #[should_panic(expected =)]
| ^^^^^^^^^^^^

error: malformed `#[should_panic]` attribute
--> ui-tests/should_panic.rs:60:27
--> ui-tests/should_panic.rs:64:27
|
60 | #[should_panic(expected = 5)]
64 | #[should_panic(expected = 5)]
| ^

error: duplicate `should_panic` attribute
--> ui-tests/should_panic.rs:65:3
--> ui-tests/should_panic.rs:69:3
|
65 | #[should_panic = "test"]
69 | #[should_panic = "test"]
| ^^^^^^^^^^^^