Python: Add test

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-11-06 13:30:11 +01:00
parent 64b9e9150e
commit fe186bf854

View File

@@ -0,0 +1,32 @@
def test_conditoinal_function(cond):
def foo():
return "foo"
def bar():
return "bar"
if cond:
f = foo
else:
f = bar
sink = f()
return sink
f_false = test_conditoinal_function(False)
f_true = test_conditoinal_function(True)
def foo():
return "foo"
def test_redefinition():
f = foo
def foo():
return "refined"
sink = f()
return sink