mirror of
https://github.com/avinal/The-Hack-Assembler.git
synced 2026-01-10 23:28:33 +05:30
symbol test added
This commit is contained in:
24
tests/symbol_test.cpp
Normal file
24
tests/symbol_test.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "catch/catch.hpp"
|
||||
#include "../include/symbol_table.hpp"
|
||||
|
||||
symbol_table table;
|
||||
|
||||
TEST_CASE("Add a Symbol")
|
||||
{
|
||||
table.add_entry("avii", 47);
|
||||
table.add_entry("krish", 7);
|
||||
table.add_entry("cosmos", 0);
|
||||
table.add_entry("noone", 90);
|
||||
REQUIRE(table.contains("avii"));
|
||||
REQUIRE(table.contains("krish"));
|
||||
REQUIRE(table.contains("cosmos"));
|
||||
REQUIRE(table.contains("noone"));
|
||||
}
|
||||
|
||||
TEST_CASE("Get Address")
|
||||
{
|
||||
REQUIRE(table.get_address("avii") == 47);
|
||||
REQUIRE(table.get_address("krish") == 7);
|
||||
REQUIRE(table.get_address("cosmos") == 0);
|
||||
REQUIRE(table.get_address("noone") == 90);
|
||||
}
|
||||
Reference in New Issue
Block a user