File: depth.tst

package info (click to toggle)
gap 4r10p0-7
  • links: PTS
  • area: main
  • in suites: buster
  • size: 47,392 kB
  • sloc: ansic: 118,475; xml: 54,089; sh: 4,112; perl: 1,654; makefile: 274
file content (32 lines) | stat: -rw-r--r-- 845 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
gap> START_TEST("depth.tst");

# We don't know what the recursion depth will be when the test starts,
# so do relative comparisons.
gap> curdepth := GetRecursionDepth();;
gap> GetRecursionDepth() - curdepth;
0
gap> dive := function(depth)
>  if depth>1 then
>    dive(depth-1);
>  else
>    Print("Depth ", GetRecursionDepth() - curdepth, "\n");
>  fi;
> end;;
gap> dive(10);
Depth 10
gap> dive(80);
Depth 80
gap> SetRecursionTrapInterval(50);
gap> dive(80);
Error, recursion depth trap (50)
gap> SetRecursionTrapInterval(5000);
gap> dive(80);
Depth 80

# Just want an error to occur to check the depth is reset correctly
gap> IsAbelian(2);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `IsCommutative' on 1 arguments
gap> dive(80);
Depth 80
gap> STOP_TEST( "depth.tst", 1);