Skip to content

Commit

Permalink
Update test_next_if.py
Browse files Browse the repository at this point in the history
  • Loading branch information
krstf1 authored Jun 24, 2024
1 parent ad7937a commit 248f9a4
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions test/test_next_if.py
Original file line number Diff line number Diff line change
@@ -1,37 +1 @@
from lizard_languages.code_reader import CodeStateMachine, next_if_branch_coverage, print_next_if_coverage

def test_next_if_token_not_equal():
next_if_branch_coverage["token_not_equal_branch"] = False
next_if_branch_coverage["token_equal_branch"] = False

mock_context = {}
instance = CodeStateMachine(mock_context)

instance.next = lambda state, token: None

instance.next_if("state1", "token1", "expected")
assert next_if_branch_coverage["token_not_equal_branch"] is True
assert next_if_branch_coverage["token_equal_branch"] is False

print("After testing token not equal case:")
print_next_if_coverage()

def test_next_if_token_equal():
next_if_branch_coverage["token_not_equal_branch"] = False
next_if_branch_coverage["token_equal_branch"] = False

mock_context = {}
instance = CodeStateMachine(mock_context)

instance.next = lambda state, token: None

instance.next_if("state1", "expected", "expected")
assert next_if_branch_coverage["token_not_equal_branch"] is False
assert next_if_branch_coverage["token_equal_branch"] is True

print("After testing token equal case:")
print_next_if_coverage()

if __name__ == "__main__":
test_next_if_token_not_equal()
test_next_if_token_equal()

0 comments on commit 248f9a4

Please sign in to comment.