mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-07-31 03:51:56 +00:00
Migrate #![no_std]
tests to wasm
This required getting a little creative in a few places, but otherwise these tests shouldn't need the test builder any more.
This commit is contained in:
28
tests/no-std/test.rs
Normal file
28
tests/no-std/test.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
//! This is a test that we compile `wasm-bindgen` itself in `no_std` mode and we
|
||||
//! can export/import various items.
|
||||
//!
|
||||
//! This doesn't actually run any tests, it's mostly a compile-time verification
|
||||
//! that things work.
|
||||
|
||||
#![feature(use_extern_macros)]
|
||||
#![no_std]
|
||||
#![allow(dead_code)]
|
||||
|
||||
extern crate wasm_bindgen;
|
||||
extern crate std as _some_other_name;
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn foo(_a: u32) {}
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
fn test(a: &str);
|
||||
|
||||
type Js;
|
||||
#[wasm_bindgen(constructor)]
|
||||
fn new() -> Js;
|
||||
#[wasm_bindgen(method, structural)]
|
||||
fn init(this: &Js);
|
||||
}
|
Reference in New Issue
Block a user