include!(env!("BINDINGS"));
use crate::test::list_in_variant::to_test::*;
struct Component;
export!(Component);
impl Guest for Component {
fn run() {
let hw: Vec<String> = ["hello", "world"].into_iter().map(Into::into).collect();
assert_eq!(list_in_option(Some(&hw)), "hello,world");
assert_eq!(list_in_option(None), "none");
let fbb = PayloadOrEmpty::WithData(vec!["foo".into(), "bar".into(), "baz".into()]);
assert_eq!(list_in_variant(&fbb), "foo,bar,baz");
assert_eq!(list_in_variant(&PayloadOrEmpty::Empty), "empty");
let abc: Vec<String> = ["a", "b", "c"].into_iter().map(Into::into).collect();
assert_eq!(list_in_result(Ok(&abc)), "a,b,c");
assert_eq!(list_in_result(Err("oops")), "err:oops");
let hw2: Vec<String> = ["hello", "world"].into_iter().map(Into::into).collect();
let s = list_in_option_with_return(Some(&hw2));
assert_eq!(s.count, 2);
assert_eq!(s.label, "hello,world");
let s = list_in_option_with_return(None);
assert_eq!(s.count, 0);
assert_eq!(s.label, "none");
let xyz: Vec<String> = ["x", "y", "z"].into_iter().map(Into::into).collect();
assert_eq!(top_level_list(&xyz), "x,y,z");
}
}