package org.shedlang.compiler.shidtopatio; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.shedlang.compiler.shid.instructions.Shid; import org.shedlang.compiler.testing.snapshots.SnapshotResolver; import org.shedlang.compiler.testing.snapshots.Snapshotter; import java.io.IOException; import static org.shedlang.compiler.shidtopatio.ShidToPatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) public class ShidToPatioPushStringTests { @Test public void pushStringIsCompiledToDataAndIndexToData(Snapshotter snapshotter) throws IOException { var shidInstruction = Shid.pushString("hello"); var context = ShidToPatioContext.EMPTY; var result = ShidToPatio.generateInstruction(shidInstruction, context); snapshotter.assertSnapshot(serialize(result)); } @Test public void canHaveMultipleStrings(Snapshotter snapshotter) throws IOException { var context = ShidToPatioContext.EMPTY; var result = ShidToPatio.generateInstruction(Shid.pushString("hello"), context); result = ShidToPatio.generateInstruction(Shid.pushString("world"), result); snapshotter.assertSnapshot(serialize(result)); } }