File: boolean.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 (84 lines) | stat: -rw-r--r-- 1,861 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#############################################################################
##
#W  boolean.tst                GAP Library                      Thomas Breuer
##
##
#Y  Copyright (C)  1997,  Lehrstuhl D für Mathematik,  RWTH Aachen,  Germany
##
##
gap> START_TEST("boolean.tst");
gap> not true;
false
gap> not false;
true
gap> true = true;
true
gap> true = false;
false
gap> false = true;
false
gap> false = false;
true
gap> true < true;
false
gap> true < false;
true
gap> false < true;
false
gap> false < false;
false
gap> true or true;
true
gap> true or false;
true
gap> false or true;
true
gap> false or false;
false
gap> true and true;
true
gap> true and false;
false
gap> false and true;
false
gap> false and false;
false
gap> String(true); String(false); String(fail);
"true"
"false"
"fail"
gap> ViewString(true); ViewString(false); ViewString(fail);
"true"
"false"
"fail"
gap> TNAM_OBJ(fail);
"boolean or fail"

# test error handling
gap> not 1;
Error, <expr> must be 'true' or 'false' (not a integer)
gap> false or 1;
Error, <expr> must be 'true' or 'false' (not a integer)
gap> 1 or false;
Error, <expr> must be 'true' or 'false' (not a integer)
gap> true and 1;
Error, <expr> must be 'true' or 'false' (not a integer)
gap> 1 and true;
Error, <expr> must be 'true' or 'false' (not a integer)
gap> ReturnTrue and ReturnTrue;
Error, <expr> must be 'true' or 'false' (not a function)
gap> ReturnTrue and true;
Error, <expr> must be 'true' or 'false' (not a function)
gap> IsAssociative and ReturnTrue;
Error, <expr> must be 'true' or 'false' (not a function)
gap> IsAssociative and true;
Error, <expr> must be 'true' or 'false' (not a function)
gap> true and IsAssociative;
Error, <expr> must be 'true' or 'false' (not a function)

#
gap> STOP_TEST( "boolean.tst", 1);

#############################################################################
##
#E