Alex Crichton a949482e3a
Remove usage of #[wasm_custom_section] (#509)
This has been stabilized on nightly as `#[link_section]`, so no need for an
unstable attribute any more. Yay!
2018-07-19 08:57:18 -05:00

36 lines
980 B
Rust

use super::websys_project;
#[test]
fn response() {
websys_project()
.file(
"src/lib.rs",
r#"
#![feature(use_extern_macros)]
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
extern crate web_sys;
#[wasm_bindgen]
pub fn test_response(response: &web_sys::Response) {
assert!(!response.ok());
assert!(!response.redirected());
assert_eq!(response.status(), 501);
}
"#,
)
.file(
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
export function test() {
let response = new Response(null, {status: 501});
wasm.test_response(response);
}
"#,
)
.test();
}