From 2c0b9a604770bfc9a8128cd03ccfc71bea3a1633 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 19 Jul 2023 21:15:22 +0100 Subject: Add Patio code for local-store --- .../patio/PatioCodeGenLocalStoreTests.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalStoreTests.java (limited to 'src/test/java') 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)); + } +} -- cgit v1.2.3