blob: 511c2f5ec7de186086985cccbb763663b6a75d3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package org.shedlang.compiler.shid;
import org.junit.jupiter.api.Test;
import org.shedlang.compiler.ast.typed.Typed;
import static org.shedlang.compiler.shid.instructions.ShidMatchers.isShidPushUnit;
import static org.zwobble.precisely.AssertThat.assertThat;
import static org.zwobble.precisely.Matchers.isSequence;
public class ShidCodeGenUnitLiteralTests {
@Test
public void unitLiteralIsCompiledToPushUnitInstruction() {
var node = Typed.unitLiteral();
var context = ShidCodeGen.Context.EMPTY;
var result = ShidCodeGen.compileExpression(node, context);
assertThat(result.instructions(), isSequence(
isShidPushUnit()
));
}
}
|