File: switch.tst

package info (click to toggle)
gap 4r8p6-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 33,476 kB
  • ctags: 7,663
  • sloc: ansic: 108,841; xml: 47,807; sh: 3,628; perl: 2,342; makefile: 796; asm: 62; awk: 6
file content (34 lines) | stat: -rw-r--r-- 908 bytes parent folder | download | duplicates (2)
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
## Test SWITCH_OBJ and FORCE_SWITCH_OBJ
gap> START_TEST("switch.tst");
gap> x := [1];;
gap> y := [2];;
gap> x2 := x;;
gap> y2 := y;;
gap> IsIdenticalObj(x,x2) and IsIdenticalObj(y,y2);
true
gap> IsIdenticalObj(x,y2) or IsIdenticalObj(y,x2);
false
gap> SWITCH_OBJ(x,y);
gap> x = [2] and x2 = [2] and y = [1] and y2 = [1];
true
gap> IsIdenticalObj(x,x2) and IsIdenticalObj(y,y2);
true
gap> IsIdenticalObj(x,y2) or IsIdenticalObj(y,x2);
false
gap> FORCE_SWITCH_OBJ(x,y);
gap> x = [1] and x2 = [1] and y = [2] and y2 = [2];
true
gap> IsIdenticalObj(x,x2) and IsIdenticalObj(y,y2);
true
gap> IsIdenticalObj(x,y2) or IsIdenticalObj(y,x2);
false
gap> x := 1;;
gap> FORCE_SWITCH_OBJ(x,y);
Error, small integer objects cannot be switched
gap> x = 1 and x2 = [1] and y = [2] and y2 = [2];
true
gap> STOP_TEST( "switch.tst", 250000);

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