Fixed EvalEvaluator when there is nothing to evaluate
This commit is contained in:
@@ -400,3 +400,19 @@ def test_i_can_say_that_a_concept_isa_another_concept():
|
||||
res = sheerka.evaluate_user_input("foo isa bar")
|
||||
assert res[0].status
|
||||
assert sheerka.isinstance(res[0].body, BuiltinConcepts.SUCCESS)
|
||||
|
||||
|
||||
def test_eval_does_not_break_valid_result():
|
||||
sheerka = get_sheerka()
|
||||
sheerka.evaluate_user_input("def concept one as 1")
|
||||
sheerka.evaluate_user_input("def concept two as 2")
|
||||
|
||||
res = sheerka.evaluate_user_input("one + two")
|
||||
assert len(res) == 1
|
||||
assert res[0].status
|
||||
assert res[0].body == 3
|
||||
|
||||
res = sheerka.evaluate_user_input("eval one + two")
|
||||
assert len(res) == 1
|
||||
assert res[0].status
|
||||
assert res[0].body == 3
|
||||
|
||||
Reference in New Issue
Block a user