File: assert.g

package info (click to toggle)
gap 4.15.1-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 110,212 kB
  • sloc: ansic: 97,261; xml: 48,343; cpp: 13,946; sh: 4,900; perl: 1,650; javascript: 255; makefile: 252; ruby: 9
file content (20 lines) | stat: -rw-r--r-- 494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
runtest := function()
    Print(AssertionLevel(), "\n");
    Assert(1, false, "fail-A");
    Assert(1, false);
    Assert(0, true, "fail-B");
    Assert(0, true);
    SetAssertionLevel(2);
    Print(AssertionLevel(), "\n");
    Assert(3, false, "fail-C");
    Assert(3, false);
    Assert(2, true, "fail-D");
    Assert(2, true);

    # ensure we don't abort after an error
    BreakOnError := false;

    Assert(2, false, "pass!\n");
    Assert(2, false);
    Print("end of function\n");
end;