Tidy up a test

This commit is contained in:
Alex Crichton 2018-06-29 15:52:31 -07:00
parent e06255fba5
commit cf08aee341

View File

@ -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);
} }