|
@@ -135,6 +135,27 @@ class TestSingleMnemonics {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void testPUSH() throws SyntaxError {
|
|
|
+ PUSH mno = new PUSH("PUSH");
|
|
|
+ assertEquals(0x5f, mno.getByte());
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ PUSH mno1 = new PUSH("PUSH akfhaskh");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ PUSH mno1 = new PUSH("PUSH 12");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+
|
|
|
+ Assertions.assertThrows(SyntaxError.class, () -> {
|
|
|
+ PUSH mno1 = new PUSH("PUSH :label");
|
|
|
+ mno1.checkArgument();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
void testMnemonicFactory() throws SyntaxError {
|
|
|
Mnemonic mnemonic = MnemonicFactory.getMnemonic("SWAP", 0);
|
|
@@ -154,5 +175,8 @@ class TestSingleMnemonics {
|
|
|
|
|
|
mnemonic = MnemonicFactory.getMnemonic("FSET", 0);
|
|
|
assertEquals(FSET.class, mnemonic.getClass());
|
|
|
+
|
|
|
+ mnemonic = MnemonicFactory.getMnemonic("PUSH", 0);
|
|
|
+ assertEquals(PUSH.class, mnemonic.getClass());
|
|
|
}
|
|
|
}
|