Skip to content

Commit

Permalink
add alfabet test
Browse files Browse the repository at this point in the history
  • Loading branch information
stgm committed Oct 30, 2024
1 parent 0d23714 commit 47ee694
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/alfabetTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from checkpy import *
from _basics_no_listcomp import *
from _static_analysis import *

@t.passed(doctest_ok)
def has_functions():
"""functie `comes_before` is aanwezig"""
assert defines_function("comes_before")

@t.passed(has_functions)
def test_comes_before(test):
"""functie `comes_before` werkt correct"""
assert getFunction("comes_before")('Taylor', 'Lana') == False
assert getFunction("comes_before")('shark', 'sWoRd') == True
assert getFunction("comes_before")('Daantje', 'Daan') == False
assert getFunction("comes_before")('amanda', 'Amanda') == True, "de functie mag True geven als de woorden gelijk zijn"

@t.passed(has_functions)
def test_program(test):
"""het programma werkt correct met invoer en uitvoer"""
assert outputOf(stdinArgs=['Taylor', 'Lana'], overwriteAttributes=[("__name__", "__main__")]) == "Lana first\n"
assert outputOf(stdinArgs=['Lana', 'Taylor'], overwriteAttributes=[("__name__", "__main__")]) == "Lana first\n"
assert outputOf(stdinArgs=['amanda', 'Amanda'], overwriteAttributes=[("__name__", "__main__")]) == "No need to decide!\n"

0 comments on commit 47ee694

Please sign in to comment.