Files
wasmer/lib/runtime/tests/spectests/token.rs

43 lines
1.2 KiB
Rust
Raw Normal View History

2019-01-09 01:06:24 -05:00
// Rust test file autogenerated with cargo build (build/spectests.rs).
// Please do NOT modify it by hand, as it will be reset on next build.
// Test based on spectests/token.wast
#![allow(
warnings,
dead_code
)]
2019-01-12 17:52:14 -05:00
use std::{f32, f64};
2019-01-12 17:53:17 -05:00
use wabt::wat2wasm;
2019-01-09 01:06:24 -05:00
2019-01-12 17:52:14 -05:00
use wasmer_clif_backend::CraneliftCompiler;
2019-01-12 17:53:17 -05:00
use wasmer_runtime::types::Value;
use wasmer_runtime::{module::Module, Instance};
2019-01-12 17:52:14 -05:00
2019-01-12 17:53:17 -05:00
use crate::spectests::_common::{generate_imports, NaNCheck};
2019-01-09 01:06:24 -05:00
// Line 4
#[test]
fn c0_l4_assert_malformed() {
2019-01-12 17:53:17 -05:00
let wasm_binary = [
40, 102, 117, 110, 99, 32, 40, 100, 114, 111, 112, 32, 40, 105, 51, 50, 46, 99, 111, 110,
115, 116, 48, 41, 41, 41,
];
2019-01-09 01:06:24 -05:00
let compilation = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
2019-01-12 17:53:17 -05:00
assert!(
compilation.is_err(),
"WASM should not compile as is malformed"
);
2019-01-09 01:06:24 -05:00
}
// Line 8
#[test]
fn c1_l8_assert_malformed() {
2019-01-12 17:53:17 -05:00
let wasm_binary = [
40, 102, 117, 110, 99, 32, 98, 114, 32, 48, 100, 114, 111, 112, 41,
];
2019-01-09 01:06:24 -05:00
let compilation = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
2019-01-12 17:53:17 -05:00
assert!(
compilation.is_err(),
"WASM should not compile as is malformed"
);
2019-01-09 01:06:24 -05:00
}