8 #include <catch2/catch_test_macros.hpp>
19 using namespace nmodl;
20 using namespace visitor;
22 using namespace test_utils;
45 SCENARIO(
"AfterCVodeToCnexpVisitor changes after_cvode solver method to cnexp") {
46 GIVEN(
"Breakpoint block with after_cvode method") {
49 SOLVE states METHOD after_cvode
53 std::string output_nmodl = R"(
55 SOLVE states METHOD cnexp
59 THEN("AfterCVodeToCnexp visitor replaces after_cvode solver with cnexp") {
63 REQUIRE(
result == expected_result);
std::string run_after_cvode_to_cnexp_visitor(const std::string &text)
SCENARIO("AfterCVodeToCnexpVisitor changes after_cvode solver method to cnexp")
Visitor to change usage of after_cvode solver to cnexp.
Visitor for checking parents of ast nodes
Class that binds all pieces together for parsing nmodl file.
Visitor to change usage of after_cvode solver to cnexp.
void visit_program(ast::Program &node) override
visit node of type ast::Program
Concrete visitor for constructing symbol table from AST.
void visit_program(ast::Program &node) override
visit node of type ast::Program
Visitor for checking parents of ast nodes
int check_ast(const ast::Ast &node)
A small wrapper to have a nicer call in parser.cpp.
bool parse_string(const std::string &input)
parser Units provided as string (used for testing)
std::string reindent_text(const std::string &text, int indent_level)
Reindent nmodl text for text-to-text comparison.
encapsulates code generation backend implementations
std::string to_nmodl(const ast::Ast &node, const std::set< ast::AstNodeType > &exclude_types)
Given AST node, return the NMODL string representation.
Auto generated AST classes declaration.
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
nmodl::parser::UnitDriver driver
Utility functions for visitors implementation.