Skip to content

Commit

Permalink
Added compile errors to TestRun
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim0x60 committed Oct 17, 2023
1 parent 794ca95 commit 806559b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
18 changes: 18 additions & 0 deletions examples/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 3 additions & 1 deletion programlib/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "programlib"
version = "8.0.1"
version = "8.1.0"
description = "Programs as Objects"
authors = ["Vadim Liventsev <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 806559b

Please sign in to comment.