Skip to content

Commit

Permalink
test: add test for array in interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kmr-srbh committed Aug 13, 2024
1 parent ed7b206 commit 2e8ca19
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/lfortran/tests/test_llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,23 @@ TEST_CASE("FortranEvaluator Array 1") {
CHECK(r.result.type == FortranEvaluator::EvalResult::statement);
}

TEST_CASE("FortranEvaluator Array 2") {
CompilerOptions cu;
cu.interactive = true;
cu.po.runtime_library_dir = LCompilers::LFortran::get_runtime_library_dir();
FortranEvaluator e(cu);
LCompilers::Result<FortranEvaluator::EvalResult>
r = e.evaluate2("integer :: x(3)");
CHECK(r.ok);
CHECK(r.result.type == FortranEvaluator::EvalResult::none);
r = e.evaluate2("x = 5");
CHECK(r.ok);
CHECK(r.result.type == FortranEvaluator::EvalResult::statement);
r = e.evaluate2("print *, x");
CHECK(r.ok);
CHECK(r.result.type == FortranEvaluator::EvalResult::statement);
}

TEST_CASE("FortranEvaluator re-declaration 1") {
CompilerOptions cu;
cu.interactive = true;
Expand Down

0 comments on commit 2e8ca19

Please sign in to comment.