Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UpEnv, some other lvars tweaks #1780

Merged
merged 10 commits into from
Oct 24, 2017
Prev Previous commit
Next Next commit
Add test for UpEnv/DownEnv
  • Loading branch information
fingolfin committed Oct 20, 2017
commit d5d8c5bb381632f4692d7bc4ffe31db8b3eefd83
10 changes: 10 additions & 0 deletions tst/test-error/up-down-env.g
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
f:=lvl -> 1/lvl + f(lvl-1);
f(7);
UpEnv(1); lvl;
DownEnv(1); lvl;
DownEnv(1); lvl;
UpEnv(1); lvl;
DownEnv(10); lvl;
UpEnv(1); lvl;
UpEnv(3); lvl;
DownEnv(2); lvl;
19 changes: 19 additions & 0 deletions tst/test-error/up-down-env.g.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function( lvl ) ... end
Error, Rational operations: <divisor> must not be zero in
return 1 / lvl + f( (lvl - 1) ); at *stdin*:1 called from
f( lvl - 1 ) at *stdin*:1 called from
f( lvl - 1 ) at *stdin*:1 called from
f( lvl - 1 ) at *stdin*:1 called from
f( lvl - 1 ) at *stdin*:1 called from
f( lvl - 1 ) at *stdin*:1 called from
... at *stdin*:2
you can replace <divisor> via 'return <divisor>;'
brk> 0
brk> 1
brk> 2
brk> 1
brk> 7
brk> 6
brk> 3
brk> 5
brk>