Skip to content

Commit

Permalink
Merge pull request #313 from gramlang/infinite-recursion
Browse files Browse the repository at this point in the history
Add an example for infinite recursion
  • Loading branch information
stepchowfun authored Apr 16, 2020
2 parents 659c3c4 + e5542c1 commit ddcc553
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions examples/infinite_recursion.g
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
f = x => f x
f true
10 changes: 7 additions & 3 deletions toast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,15 @@ tasks:
cargo run -- check "$file"
done
# Run all the examples. Note that `examples/girard_paradox.g` is expected to loop forever, so
# for that example we only let it run for 5 seconds and check that it didn't finish earlier.
# Run all the examples. Note that `examples/girard_paradox.g` and
# `examples/infinite_recursion.g` are expected to loop forever, so for those examples we only
# let them run for 5 seconds and check that they didn't finish earlier.
for file in examples/*.g; do
echo "Running $file..."
if [ "$file" = 'examples/girard_paradox.g' ]; then
if
[ "$file" = 'examples/girard_paradox.g' ] ||
[ "$file" = 'examples/infinite_recursion.g' ]
then
if timeout 5 cargo run -- run "$file"; then
echo 'This example was supposed to time out.' >&2
exit 1
Expand Down

0 comments on commit ddcc553

Please sign in to comment.