Removed test that are expecting wrong results
This commit is contained in:
parent
e7cb2de198
commit
d1d3421376
@ -71,11 +71,12 @@ Result<Value> Interpreter::eval(Ast &&ast)
|
|||||||
case Ast::Type::Literal:
|
case Ast::Type::Literal:
|
||||||
switch (ast.token.type) {
|
switch (ast.token.type) {
|
||||||
case Token::Type::Symbol:
|
case Token::Type::Symbol:
|
||||||
{
|
if (ast.token.source != "nil") {
|
||||||
auto const value = env().find(std::string(ast.token.source));
|
auto const value = env().find(std::string(ast.token.source));
|
||||||
assert(value, "Missing variable error is not implemented yet");
|
assert(value, "Missing variable error is not implemented yet");
|
||||||
return *value;
|
return *value;
|
||||||
}
|
}
|
||||||
|
return Value{};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return Value::from(ast.token);
|
return Value::from(ast.token);
|
||||||
|
@ -40,7 +40,7 @@ suite intepreter_test = [] {
|
|||||||
should("evaluate literals") = [] {
|
should("evaluate literals") = [] {
|
||||||
evaluates_to(Value{}, "nil");
|
evaluates_to(Value{}, "nil");
|
||||||
evaluates_to(Value::number(Number(10)), "10");
|
evaluates_to(Value::number(Number(10)), "10");
|
||||||
evaluates_to(Value::symbol("notexistingsymbol"), "notexistingsymbol");
|
// evaluates_to(Value::symbol("notexistingsymbol"), "notexistingsymbol");
|
||||||
};
|
};
|
||||||
|
|
||||||
should("evaluate arithmetic") = [] {
|
should("evaluate arithmetic") = [] {
|
||||||
@ -52,7 +52,7 @@ suite intepreter_test = [] {
|
|||||||
|
|
||||||
should("call builtin functions") = [] {
|
should("call builtin functions") = [] {
|
||||||
evaluates_to(Value::symbol("nil"), "typeof nil");
|
evaluates_to(Value::symbol("nil"), "typeof nil");
|
||||||
evaluates_to(Value::symbol("symbol"), "typeof foo");
|
// evaluates_to(Value::symbol("symbol"), "typeof foo");
|
||||||
evaluates_to(Value::symbol("number"), "typeof 100");
|
evaluates_to(Value::symbol("number"), "typeof 100");
|
||||||
|
|
||||||
produces_output("say 5", "5\n");
|
produces_output("say 5", "5\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user