buffalo
Loading...
Searching...
No Matches
buffalo.test.cpp
Go to the documentation of this file.
1
#include <gtest/gtest.h>
2
#include <
buffalo/buffalo.h
>
3
4
TEST
(Parser, Construction)
5
{
6
auto
parser =
bf::SLRParser<G>::Build
(statement);
7
ASSERT_TRUE(parser.has_value());
8
}
9
10
TEST
(Parser, Evaluation)
11
{
12
auto
parser = *
bf::SLRParser<G>::Build
(statement);
13
14
auto
res = parser.Parse(
"3 * 3 + 4^2 - (9 / 3)"
);
15
ASSERT_TRUE(res.has_value());
16
17
ASSERT_EQ(res->GetValue(), 22.0);
18
}
buffalo.h
TEST
TEST(Parser, Construction)
Definition
buffalo.test.cpp:4
bf::SLRParser::Build
static std::expected< SLRParser, Error > Build(NonTerminal< G > &start)
Definition
buffalo.h:1361
test
buffalo.test.cpp
Generated by
1.9.8