use indoc!

This commit is contained in:
NikVolf
2019-01-27 12:14:14 +03:00
parent 5b2cd9c4c6
commit 38e0f254b0
3 changed files with 79 additions and 80 deletions

View File

@ -16,6 +16,7 @@ byteorder = { version = "1", default-features = false }
tempdir = "0.3"
wabt = "0.2"
diff = "0.1.11"
indoc = "0.3"
[features]
default = ["std"]

View File

@ -792,15 +792,13 @@ mod tests {
#[test]
fn smoky() {
let sample = load_sample(r#"
let sample = load_sample(indoc!(r#"
(module
(type (func))
(func (type 0))
(memory 0 1)
(export "simple" (func 0))
)
"#
);
(export "simple" (func 0)))"#
));
assert_eq!(sample.types.len(), 1);
assert_eq!(sample.funcs.len(), 1);
@ -814,7 +812,7 @@ mod tests {
#[test]
fn table() {
let mut sample = load_sample(r#"
let mut sample = load_sample(indoc!(r#"
(module
(import "env" "foo" (func $foo))
(func (param i32)
@ -833,7 +831,7 @@ mod tests {
;; Refer all types of functions: imported, defined not exported and defined exported.
(elem (i32.const 0) 0 1 2)
)"#
);
));
{
let element_func = &sample.elements[0].value[1];
@ -864,7 +862,7 @@ mod tests {
#[test]
fn new_import() {
let mut sample = load_sample(r#"
let mut sample = load_sample(indoc!(r#"
(module
(type (;0;) (func))
(type (;1;) (func (param i32 i32) (result i32)))
@ -880,7 +878,7 @@ mod tests {
call 1
)
)"#
);
));
{
let type_ref_0 = sample.types.clone_ref(0);
@ -922,7 +920,7 @@ mod tests {
#[test]
fn simple_opt() {
let mut sample = load_sample(r#"
let mut sample = load_sample(indoc!(r#"
(module
(type (;0;) (func))
(type (;1;) (func (param i32 i32) (result i32)))
@ -952,9 +950,8 @@ mod tests {
(func (type 0)
call 3
)
)"#
);
));
validate_sample(&sample);

View File

@ -7,8 +7,9 @@ extern crate alloc;
extern crate byteorder;
extern crate parity_wasm;
#[macro_use]
extern crate log;
#[macro_use] extern crate log;
#[cfg(test)] #[macro_use] extern crate indoc;
pub mod rules;