-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Describe the Bug
When using wasm-bindgen-test
via wasm-pack test
, if any struct have a name beginning with Test
or test
and have the #[wasm-bindgen]
macro the tests will fail to run.
Steps to Reproduce
wasm-bindgen = "0.2.62"
wasm-bindgen-test = "0.3.12"
- Add the following to a fresth
lib.rs
and runwasm-pack test --node
.
#[wasm_bindgen]
pub struct Test;
#[cfg(test)]
pub mod test {
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn pass() {
assert_eq!(1, 1);
}
}
Actual Behavior
These struct names work:
ConnectionTest
SocketTest
ATest
Attestation
These names fail:
Test
TestConnection
Testnet
Testify
test
testify
Removing the #[wasm-bindgen]
macro causes everything to succeed. Packages can be built succesfully, imported into Node, and used normally. Only tests break
Failures produce the following error message (stack information has been trimmed):
$ wasm-pack test --node
panicked at 'exception thrown while creating a test: Error: recursive use of an object detected which would lead to unsafe aliasing in rust