23 lines
459 B
C++
23 lines
459 B
C++
|
#include <catch2/catch.hpp>
|
||
|
#include "../lib/Factory.hpp"
|
||
|
|
||
|
class ParserTest
|
||
|
{
|
||
|
public:
|
||
|
explicit ParserTest() {}
|
||
|
virtual ~ParserTest() {}
|
||
|
|
||
|
protected:
|
||
|
sk::Logger m_logger;
|
||
|
sk::Factory m_factory {"tests/parser", m_logger};
|
||
|
};
|
||
|
|
||
|
TEST_CASE_METHOD(ParserTest, "Parser_built-in")
|
||
|
{
|
||
|
auto parser = m_factory.make_parser();
|
||
|
auto root = parser->parse(" 34 'hello' false");
|
||
|
|
||
|
REQUIRE("PROG(INT[34],STRING['hello'],BOOL[false])"
|
||
|
== root->string());
|
||
|
}
|