We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents abb7f0e + a939206 commit 9a1c80cCopy full SHA for 9a1c80c
packages/vm/src/wasm_backend/engine.rs
@@ -100,6 +100,17 @@ fn limit_to_pages(limit: Size) -> Pages {
100
mod tests {
101
use super::*;
102
103
+ #[test]
104
+ fn cost_works() {
105
+ // accounting operator
106
+ assert_eq!(cost(&Operator::Br { relative_depth: 3 }), 1610);
107
+ assert_eq!(cost(&Operator::Return {}), 1610);
108
+
109
+ // anything else
110
+ assert_eq!(cost(&Operator::I64Const { value: 7 }), 115);
111
+ assert_eq!(cost(&Operator::I64Extend8S {}), 115);
112
+ }
113
114
#[test]
115
fn limit_to_pages_works() {
116
// rounds down
0 commit comments