@Test
public void testParseAssembly() {

    String assembly =
            "GlobalVariable_global1:\n" +
                    "#data       4\n" +
                    "init:       \n" +
                    "ajw         -11\n" +
                    "ldc         init~IL_35\n" +
                    "ldc         L0-L_StartP_7\n" +
                    "ldc         L0-$\n" +
                    "ldlp        $\n" +
                    "startp      \n" +
                    "END: -- exit program";
    List<Instruction> instructions = Assembler.parseAssembly(assembly);
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, "GlobalVariable_global1", null, null, null, null, null, 1),
            instructions.get(0));
    checkInstructionEquality(
            new Instruction(InstructionType.DIRECTIVE, null, null, null, null, null, "#data       4", 2),
            instructions.get(1));
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, "init", null, null, null, null, null, 3),
            instructions.get(2));
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, null, Assembler.opcodes.get("ajw"), -11L, null, null, null, 4),
            instructions.get(3));
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, null, Assembler.opcodes.get("ldc"), null, "init~IL_35", null, null, 5),
            instructions.get(4));
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, null, Assembler.opcodes.get("ldc"), null, "L0-L_StartP_7", null, null, 6),
            instructions.get(5));
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, null, Assembler.opcodes.get("ldc"), null, "L0-$", null, null, 7),
            instructions.get(6));
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, null, Assembler.opcodes.get("ldlp"), null, "$", null, null, 8),
            instructions.get(7));
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, null, Assembler.opcodes.get("startp"), null, null, null, null, 9),
            instructions.get(8));
    checkInstructionEquality(
            new Instruction(InstructionType.INSTRUCTION, "END", null, null, null, "exit program", null, 10),
            instructions.get(9));
}