diff --git a/test/emu/cpu_test.cc b/test/emu/cpu_test.cc index 7c294a43..8a56f462 100644 --- a/test/emu/cpu_test.cc +++ b/test/emu/cpu_test.cc @@ -26,7 +26,6 @@ class CpuTest : public ::testing::Test { mock_memory.Init(); EXPECT_CALL(mock_memory, ClearMemory()).Times(::testing::AtLeast(1)); mock_memory.ClearMemory(); - asm_parser.CreateInternalOpcodeMap(); } AsmParser asm_parser; @@ -42,6 +41,22 @@ using ::testing::Return; // Infrastructure // ============================================================================ +TEST_F(CpuTest, AsmParserTokenizerOk) { + AsmParser asm_parser; + std::string instruction = R"( + ADC.b #$01 + LDA.b #$FF + STA.w $2000 + )"; + + std::vector tokens = asm_parser.Tokenize(instruction); + + std::vector expected_tokens = {"ADC", ".b", "#", "$", "01", + "LDA", ".b", "#", "$", "FF", + "STA", ".w", "$", "2000"}; + EXPECT_THAT(tokens, ::testing::ContainerEq(expected_tokens)); +} + TEST_F(CpuTest, CheckMemoryContents) { MockMemory memory; std::vector data = {0x00, 0x01, 0x02, 0x03, 0x04};