Skip to content

Commit

Permalink
Fix inwer tests order (#177)
Browse files Browse the repository at this point in the history
* Fix tests order

* Add tests

* Bump version
  • Loading branch information
MasloMaslane authored Jan 29, 2024
1 parent 7ecf1c3 commit 0d55a9e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sinol_make/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from sinol_make import util, oiejq


__version__ = "1.5.20"
__version__ = "1.5.21"


def configure_parsers():
Expand Down
4 changes: 4 additions & 0 deletions src/sinol_make/commands/inwer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ def get_id(test, func=str.isalpha):
last_test = test

def is_next(last, curr):
if last == "" and curr != "a":
return False
elif last == "":
return True
i = len(last) - 1
while i >= 0:
if last[i] != 'z':
Expand Down
8 changes: 8 additions & 0 deletions tests/commands/inwer/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,11 @@ def test_verify_tests_order():
command.tests.append("abc11ocen.in")

command.verify_tests_order()

command.tests = ["abc0.in", "abc0a.in", "abc0b.in",
"abc1.in", "abc1a.in", "abc1b.in"]
command.verify_tests_order()

command.tests.remove("abc0a.in")
with pytest.raises(SystemExit):
command.verify_tests_order()

0 comments on commit 0d55a9e

Please sign in to comment.