diff options
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java b/src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java index fd2c6f1e..c7c39691 100644 --- a/src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java +++ b/src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java @@ -19,6 +19,27 @@ public class WasmBinaryFormatInstructionsTests { // == Numeric Instructions == @Test + public void canSerializeI32Add(Snapshotter snapshotter) throws IOException, InterruptedException { + var module = WasmModule.EMPTY + .addFunction(new WasmFunction( + "f", + List.of(), + List.of(), + List.of(), + new WasmExpression(List.of( + new WasmI32Const(0), + new WasmI32Const(0), + new WasmI32Add(), + new WasmDrop() + )) + )); + + var result = serializeModuleWasm32(module); + + snapshotter.assertSnapshot(result); + } + + @Test public void canSerializeI64Add(Snapshotter snapshotter) throws IOException, InterruptedException { var module = WasmModule.EMPTY .addFunction(new WasmFunction( |
