mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-20 12:10:52 +00:00
This has been stabilized on nightly as `#[link_section]`, so no need for an unstable attribute any more. Yay!
34 lines
870 B
Rust
34 lines
870 B
Rust
use super::websys_project;
|
|
|
|
#[test]
|
|
fn headers() {
|
|
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_headers(_headers: &web_sys::Headers) {
|
|
// empty for now...
|
|
}
|
|
"#,
|
|
)
|
|
.file(
|
|
"test.js",
|
|
r#"
|
|
import * as assert from "assert";
|
|
import * as wasm from "./out";
|
|
|
|
export function test() {
|
|
let headers = new Headers({'Content-Type': 'text/plain'});
|
|
wasm.test_headers(headers);
|
|
}
|
|
"#,
|
|
)
|
|
.test();
|
|
}
|