diff --git a/examples/hello.py b/examples/hello.py index c57e243..8cc6b3a 100644 --- a/examples/hello.py +++ b/examples/hello.py @@ -32,4 +32,22 @@ ([], ['Hello World!']) ]) +print(tests) + +hw = hw.replace('World', 'Earth') + +program = Program(hw, language='C++') +tests = program.test([ + ([], ['Hello World!']) +]) + +print(tests) + +hw = hw.replace(';', '!') + +program = Program(hw, language='C++') +tests = program.test([ + ([], ['Hello World!']) +]) + print(tests) \ No newline at end of file diff --git a/programlib/program.py b/programlib/program.py index e22a656..ce5e2cc 100644 --- a/programlib/program.py +++ b/programlib/program.py @@ -125,8 +125,10 @@ def test(self, test_cases, force=True): pass if not test_run: + # The program is not runnable test_run = TestRun(input_lines, expected_output_lines, - [], self.exitstatus, 0) + self.term.emulate(self.stdout) if self.stdout else [], + self.exitstatus, 0) test_runs.append(test_run) diff --git a/pyproject.toml b/pyproject.toml index ed9ba02..691eabe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "programlib" -version = "8.0.1" +version = "8.1.0" description = "Programs as Objects" authors = ["Vadim Liventsev "] license = "MIT"