mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-28 22:22:02 +00:00
test suite support iniital
This commit is contained in:
40
spec/src/test.rs
Normal file
40
spec/src/test.rs
Normal file
@ -0,0 +1,40 @@
|
||||
#![cfg(test)]
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct RuntimeValue {
|
||||
#[serde(rename = "type")]
|
||||
value_type: String,
|
||||
value: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum Action {
|
||||
#[serde(rename = "invoke")]
|
||||
Invoke { field: String, args: Vec<RuntimeValue> }
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum Command {
|
||||
#[serde(rename = "module")]
|
||||
Module { line: u64, filename: String },
|
||||
#[serde(rename = "assert_return")]
|
||||
AssertReturn {
|
||||
line: u64,
|
||||
action: Action,
|
||||
expected: Vec<RuntimeValue>,
|
||||
},
|
||||
#[serde(rename = "assert_trap")]
|
||||
AssertTrap {
|
||||
line: u64,
|
||||
action: Action,
|
||||
text: String,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct Commands {
|
||||
source_filename: String,
|
||||
commands: Vec<Command>,
|
||||
}
|
Reference in New Issue
Block a user