// Path: src/main/java/com/amanvishnani/sim8085/domain/IData.java
// public interface IData {
//     IData ZERO = Data.from("00");
//     String hexValue();
//     Integer intValue();
//     IOperationResult add(IData data);
//     IOperationResult add(IData data, Integer carry);
//     IOperationResult minus(IData data);
//     IRegister toRegister();
//     public IData getLSB();
// }
// 
// Path: src/main/java/com/amanvishnani/sim8085/domain/IOpcode.java
// public interface IOpcode {
//     String getInstruction();
//     IData getOpcodeData();
//     Integer getOpcodeLength();
// }


import com.amanvishnani.sim8085.domain.IData;
import com.amanvishnani.sim8085.domain.IOpcode;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
                LABEL: HLT
                """;
        List<String> instructions = parser.getLineInstructions(code);
        assertEquals(4, instructions.size());
        assertTrue(instructions.contains("LABEL: HLT"));
    }

    @Test
    void getOpcode() {
        IOpcode opcode = parser.getOpcode("AMAN:  JMP  LABEL");
        IOpcode opcode1 = Opcode.createOpcode("C3", 3, "JMP LABEL");
        assertEquals(opcode1, opcode);

        assertThrows(RuntimeException.class, () -> parser.getOpcode("HELLO"));
    }

    @Test
    void extractLabel() {
        String instruction = "AMAN:  JMP  LABEL";
        Assertions.assertEquals("AMAN", parser.extractLabel(instruction));
        instruction = "AMAN  :  JMP  LABEL";
        Assertions.assertEquals("AMAN", parser.extractLabel(instruction));
        instruction = "AMAN  :  HLT";
        Assertions.assertEquals("AMAN", parser.extractLabel(instruction));
        instruction = "HLT";
        Assertions.assertEquals("", parser.extractLabel(instruction));
    }

    @Test
    void extractData() {
// Path: src/main/java/com/amanvishnani/sim8085/domain/IData.java
// public interface IData {
//     IData ZERO = Data.from("00");
//     String hexValue();
//     Integer intValue();
//     IOperationResult add(IData data);
//     IOperationResult add(IData data, Integer carry);
//     IOperationResult minus(IData data);
//     IRegister toRegister();
//     public IData getLSB();
// }
// 
// Path: src/main/java/com/amanvishnani/sim8085/domain/IOpcode.java
// public interface IOpcode {
//     String getInstruction();
//     IData getOpcodeData();
//     Integer getOpcodeLength();
// }


// Path: src/test/java/com/amanvishnani/sim8085/domain/Impl/ParserTest.java
import com.amanvishnani.sim8085.domain.IData;
import com.amanvishnani.sim8085.domain.IOpcode;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;

                LABEL: HLT
                """;
        List<String> instructions = parser.getLineInstructions(code);
        assertEquals(4, instructions.size());
        assertTrue(instructions.contains("LABEL: HLT"));
    }

    @Test
    void getOpcode() {
        IOpcode opcode = parser.getOpcode("AMAN:  JMP  LABEL");
        IOpcode opcode1 = Opcode.createOpcode("C3", 3, "JMP LABEL");
        assertEquals(opcode1, opcode);

        assertThrows(RuntimeException.class, () -> parser.getOpcode("HELLO"));
    }

    @Test
    void extractLabel() {
        String instruction = "AMAN:  JMP  LABEL";
        Assertions.assertEquals("AMAN", parser.extractLabel(instruction));
        instruction = "AMAN  :  JMP  LABEL";
        Assertions.assertEquals("AMAN", parser.extractLabel(instruction));
        instruction = "AMAN  :  HLT";
        Assertions.assertEquals("AMAN", parser.extractLabel(instruction));
        instruction = "HLT";
        Assertions.assertEquals("", parser.extractLabel(instruction));
    }

    @Test
    void extractData() {
        IData _05H = Data.from("05");