-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add attribute
crate
to proc-macro wasm_bindgen_test
This attribute allow to specify a path where `wasm-bindgen-test` can be accessed. Closes #3588
- Loading branch information
1 parent
cbb89a0
commit 4ae9cdd
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#![no_implicit_prelude] | ||
|
||
extern crate wasm_bindgen_test_macro; | ||
// | ||
use wasm_bindgen_test_macro::wasm_bindgen_test; | ||
|
||
pub mod wasm { | ||
pub extern crate wasm_bindgen_test as test; | ||
} | ||
|
||
#[wasm_bindgen_test(crate = ::wasm_bindgen_test)] | ||
fn success_1() {} | ||
|
||
#[wasm_bindgen_test(crate = crate::wasm::test)] | ||
fn success_2() {} | ||
|
||
#[wasm_bindgen_test(crate = foo)] | ||
fn failure_1() {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error[E0433]: failed to resolve: use of undeclared crate or module `foo` | ||
--> ui-tests/crate.rs:17:29 | ||
| | ||
17 | #[wasm_bindgen_test(crate = foo)] | ||
| ^^^ use of undeclared crate or module `foo` |