mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-25 11:02:11 +03:00
Tidy up a test
This commit is contained in:
parent
e06255fba5
commit
cf08aee341
@ -674,7 +674,9 @@ fn custom_type() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unused_imports_not_generated() {
|
fn unused_imports_not_generated() {
|
||||||
project()
|
let mut project = project();
|
||||||
|
|
||||||
|
project
|
||||||
.debug(false)
|
.debug(false)
|
||||||
.file("src/lib.rs", r#"
|
.file("src/lib.rs", r#"
|
||||||
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
|
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
|
||||||
@ -701,10 +703,7 @@ fn unused_imports_not_generated() {
|
|||||||
"#)
|
"#)
|
||||||
.test();
|
.test();
|
||||||
|
|
||||||
let out = ::root().join("out.js");
|
let contents = project.read_js();
|
||||||
let mut contents = String::new();
|
|
||||||
File::open(&out).unwrap()
|
|
||||||
.read_to_string(&mut contents).unwrap();
|
|
||||||
assert!(contents.contains("run"), "didn't find `run` in {}", contents);
|
assert!(contents.contains("run"), "didn't find `run` in {}", contents);
|
||||||
assert!(!contents.contains("foo"), "found `foo` in {}", contents);
|
assert!(!contents.contains("foo"), "found `foo` in {}", contents);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user