diff options
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalStoreTests.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalStoreTests.java b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalStoreTests.java new file mode 100644 index 00000000..9f9461c5 --- /dev/null +++ b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalStoreTests.java @@ -0,0 +1,23 @@ +package org.shedlang.compiler.patio; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.shedlang.compiler.stackir.instructions.Instructions; +import org.shedlang.compiler.testing.snapshots.SnapshotResolver; +import org.shedlang.compiler.testing.snapshots.Snapshotter; + +import java.io.IOException; + +import static org.shedlang.compiler.patio.PatioTesting.serialize; + +@ExtendWith({SnapshotResolver.class}) +public class PatioCodeGenLocalStoreTests { + @Test + public void localStoreGeneratesLocalStore(Snapshotter snapshotter) throws IOException { + var stackIr = Instructions.localStore("x"); + + var result = PatioCodeGen.generateInstruction(stackIr); + + snapshotter.assertSnapshot(serialize(result)); + } +} |
