};
TestExecutor exec(std::move(vars));
EvaluationContext ec { exec };
- ASSERT_NO_THROW(result->evaluate(ec));
+ try {
+ result->evaluate(ec);
+ } catch (EvaluationFailure e) {
+ std::ostringstream os;
+ if (e.hasLocation())
+ os << e.location().toString() << ": ";
+ os << e.message();
+ FAIL() << os.str();
+ } catch (...) {
+ FAIL() << "unknown exception";
+ }
ASSERT_TRUE(!result2.empty());
ASSERT_EQ(result2, "1,qwe,rty,true");
}
auto tokens = lexTest(error, "test", txt);
ASSERT_TRUE(error.empty()) << error;
+ // {
+ // size_t index = 0;
+ // for(auto &t : tokens)
+ // std::cout << t.location().toString() << ": " << (index++) << " '" << t.text() << "' " << toString(t.type()) << "\n";
+ // }
+
std::vector<std::string> errors;
auto result = parseTokens(errors, tokens);
// {
// std::ostringstream tmp;
- // result->debug(tmp, 0);
+ // result->printSelfInfo(tmp, 0);
// std::cout << tmp.str();
// }