Skip to content

Commit

Permalink
fixed tests, added probe
Browse files Browse the repository at this point in the history
  • Loading branch information
refaktor committed Feb 19, 2024
1 parent 85f642a commit 2ddb959
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1,292 deletions.
8 changes: 8 additions & 0 deletions evaldo/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,14 @@ var builtins = map[string]*env.Builtin{
return arg0
},
},
"probe": { // **
Argsn: 1,
Doc: "Prints information about a value.",
Fn: func(ps *env.ProgramState, arg0 env.Object, arg1 env.Object, arg2 env.Object, arg3 env.Object, arg4 env.Object) env.Object {
fmt.Println(arg0.Inspect(*ps.Idx))
return arg0
},
},
"inspect": { // **
Argsn: 1,
Doc: "Returs information about a value.",
Expand Down
14 changes: 7 additions & 7 deletions tests/basics.rye
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@ section "Doers and evaluators"
equal { do { 101 + 101 } } 202
}

group "do-in"
mold\nowrap ?do-in
group "do\in"
mold\nowrap ?do\in
{ { context } { block } }
{
equal { cc: context { x: 101 } do-in cc { x + 101 } } 202
equal { cc: context { x: 101 } do\in cc { x + 101 } } 202
}

group "with"
Expand All @@ -401,11 +401,11 @@ section "Doers and evaluators"
equal { try { 10 + unknown } |type? } 'error
}

group "do-in\try"
mold\nowrap ?do-in\try
group "do\in\try"
mold\nowrap ?do\in\try
{ { context } { block } }
{
equal { ctx: context { x: 101 } do-in\try ctx { x / 0 } |type? } 'error
equal { ctx: context { x: 101 } do\in\try ctx { x / 0 } |type? } 'error
}

group "vals"
Expand Down Expand Up @@ -481,4 +481,4 @@ section "Function creating functions"

}

end
end
Loading

0 comments on commit 2ddb959

Please sign in to comment.