diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2021-09-02 13:05:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 20:05:59 +0000 |
commit | cf79199f0dde04e709acbf355c5be769f8647533 (patch) | |
tree | 180b2191586fe8c662ee2c693d46c0f8e70eaa98 /src/main/interactive_shell.h | |
parent | a0fede7caca61826f9f82ae8bb60e1dae3c68104 (diff) |
[Unit Tests] Fix shell test for Editline (#7117)
When using --editline, our interactive_shell_black unit test was not
working because the unit test was redirecting std::cin and std::cout
to std::stringstreams, which does not work with Editline. This commit
refactors our InteractiveShell class to explicitly take the input and
output streams as arguments, which fixes the issue because we do not use
Editline for input streams that are not std::cin. Additionally, the
commit updates the unit test to use SMT-LIB syntax instead of the
deprecated CVC language.
Diffstat (limited to 'src/main/interactive_shell.h')
-rw-r--r-- | src/main/interactive_shell.h | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/src/main/interactive_shell.h b/src/main/interactive_shell.h index bf05a1ec7..6029d6b0e 100644 --- a/src/main/interactive_shell.h +++ b/src/main/interactive_shell.h @@ -35,6 +35,29 @@ class SymbolManager; class InteractiveShell { + public: + InteractiveShell(api::Solver* solver, + SymbolManager* sm, + std::istream& in, + std::ostream& out); + + /** + * Close out the interactive session. + */ + ~InteractiveShell(); + + /** + * Read a command from the interactive shell. This will read as + * many lines as necessary to parse a well-formed command. + */ + Command* readCommand(); + + /** + * Return the internal parser being used. + */ + parser::Parser* getParser() { return d_parser; } + + private: api::Solver* d_solver; std::istream& d_in; std::ostream& d_out; @@ -46,26 +69,6 @@ class InteractiveShell static const std::string INPUT_FILENAME; static const unsigned s_historyLimit = 500; - -public: - InteractiveShell(api::Solver* solver, SymbolManager* sm); - - /** - * Close out the interactive session. - */ - ~InteractiveShell(); - - /** - * Read a command from the interactive shell. This will read as - * many lines as necessary to parse a well-formed command. - */ - Command* readCommand(); - - /** - * Return the internal parser being used. - */ - parser::Parser* getParser() { return d_parser; } - };/* class InteractiveShell */ } // namespace cvc5 |