This repository has been archived on 2023-09-09. You can view files and clone it, but cannot push or open issues/pull-requests.
skemla/tests/Parser.cpp

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());
}