#![no_std]
#![allow(unused_macros)]
#![allow(dead_code, unused_variables)]
extern crate alloc;
mod codegen_tests {
macro_rules! codegen_test {
(wasi_cli $name:tt $test:tt) => {};
(wasi_http $name:tt $test:tt) => {};
($id:ident $name:tt $test:tt) => {
mod $id {
wit_bindgen::generate!({
path: $test,
std_feature,
stubs,
generate_all
});
#[test]
fn works() {}
}
};
}
test_helpers::codegen_tests!();
}
mod strings {
use alloc::string::String;
wit_bindgen::generate!({
inline: "
package my:strings;
world not-used-name {
import cat: interface {
foo: func(x: string);
bar: func() -> string;
}
}
",
std_feature,
});
#[allow(dead_code)]
fn test() {
cat::foo("hello");
let _t: String = cat::bar();
}
}
mod raw_strings {
use alloc::vec::Vec;
wit_bindgen::generate!({
inline: "
package raw:strings;
world not-used-name {
import cat: interface {
foo: func(x: string);
bar: func() -> string;
}
}
",
raw_strings,
std_feature,
});
#[allow(dead_code)]
fn test() {
cat::foo(b"hello");
let _t: Vec<u8> = cat::bar();
}
}
mod skip {
wit_bindgen::generate!({
inline: "
package foo:foo;
world baz {
export exports: interface {
foo: func();
bar: func();
}
}
",
skip: ["foo"],
std_feature,
});
struct Component;
impl exports::exports::Guest for Component {
fn bar() {}
}
export!(Component);
}