We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20adb3f commit 92c07dcCopy full SHA for 92c07dc
tests/test_check_function.py
@@ -520,3 +520,22 @@ def test_function_call_in_comparison(code):
520
sct = "Ex().check_function('len')"
521
res = helper.run({"DC_CODE": code, "DC_SOLUTION": code, "DC_SCT": sct})
522
assert res["correct"]
523
+
524
525
+def test_ho_function():
526
+ # TODO: FunctionParser.visit_Call should append something to name to discern HOF calls
527
+ # e.g. () if node.func is Func (this should only affect limited exercises)
528
+ sct = "Ex().check_function('hof').check_args(0).has_equal_value(override=2)"
529
530
+ code = """
531
+def hof(arg1):
532
+ def inner(arg2):
533
+ return arg1, arg2
534
535
+ return inner
536
537
+hof(1)(2)
538
+ """
539
540
+ res = helper.run({"DC_CODE": code, "DC_SOLUTION": code, "DC_SCT": sct})
541
+ assert res["correct"]
0 commit comments