#############################################################################
##
##  This file tests record comparison and names, in particular long names.
##
#@local aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaxy
#@local aaaxy,aaaxyz,names,r,str1021,str1022a,str1022b,str1023,str1024,x
gap> START_TEST("recordname.tst");
gap> x := Immutable(rec(x := 2));
rec( x := 2 )
gap> Unbind(x.x);
Error, Record Unbind: <rec> must be a mutable record
gap> x.y := 2;
Error, Record Assignment: <rec> must be a mutable record
gap> x.x := 2;
Error, Record Assignment: <rec> must be a mutable record
gap> r := rec(x := 2, y := 3);
rec( x := 2, y := 3 )
gap> r.x;
2
gap> r.y;
3
gap> r.("x");
2
gap> str1021 := List([1..1021], x -> 'a');;
gap> str1022a := Concatenation(str1021, "a");;
gap> str1022b := Concatenation(str1021, "b");;
gap> str1023 := Concatenation(str1021, "aa");;
gap> str1024 := Concatenation(str1021, "aaa");;
gap> r.(str1021) := 1;
1
gap> r.(str1022a) := 2;
2
gap> r.(str1022b) := 3;
3
gap> r.(str1023) := 4;
4
gap> r.(str1024) := 5;
Error, Record names must consist of at most 1023 characters
gap> names := RecNames(r);;
gap> SortedList(names) = [str1021, str1022a, str1023, str1022b, "x", "y"];
true
gap> RecNames( () );
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `RecNames' on 1 arguments
gap> REC_NAMES( () );
Error, REC_NAMES: <rec> must be a record (not a permutation (small))
gap> REC_NAMES_COMOBJ( () );
Error, REC_NAMES_COMOBJ: <rec> must be a component object (not a permutation (\
small))
gap> rec() < rec(x := 1);
true
gap> rec(x := 1) = rec(x := 2);
false
gap> rec(x := 1) = rec(y := 1);
false
gap> rec(x := 1) < rec(x := 2);
true
gap> rec(x := 1) < rec();
false
gap> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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, RNamObj("x"));
Error, Record Element: '<rec>.x' must have an assigned value
gap> \.(r, 0);
Error, Record Element: <rnam> must be a positive small integer (not the intege\
r 0)
gap> \.(r, -1);
Error, Record Element: <rnam> must be a positive small integer (not the intege\
r -1)
gap> \.(r, 2^1000);
Error, Record Element: <rnam> must be a positive small integer (not a large po\
sitive integer)
gap> \.(r, "a");
Error, Record Element: <rnam> must be a positive small integer (not a list (st\
ring))
gap> \.(r, 100000000);
Error, Record Element: <rnam> must be a valid rnam (not the integer 100000000)

##
gap> IsBound\.(r, RNamObj("y"));
true
gap> IsBound\.(r, RNamObj("x"));
false
gap> IsBound\.(r, 0);
Error, Record IsBound: <rnam> must be a positive small integer (not the intege\
r 0)
gap> IsBound\.(r, -1);
Error, Record IsBound: <rnam> must be a positive small integer (not the intege\
r -1)
gap> IsBound\.(r, 2^1000);
Error, Record IsBound: <rnam> must be a positive small integer (not a large po\
sitive integer)
gap> IsBound\.(r, "a");
Error, Record IsBound: <rnam> must be a positive small integer (not a list (st\
ring))
gap> IsBound\.(r, 100000000);
Error, Record IsBound: <rnam> must be a valid rnam (not the integer 100000000)

##
gap> r;
rec( y := 2 )
gap> Unbind\.(r, RNamObj("y"));
gap> r;
rec(  )
gap> Unbind\.(r, RNamObj("y"));
gap> r;
rec(  )
gap> Unbind\.(r, RNamObj("x"));
gap> Unbind\.(r, 0);
Error, Record Unbind: <rnam> must be a positive small integer (not the integer\
 0)
gap> Unbind\.(r, -1);
Error, Record Unbind: <rnam> must be a positive small integer (not the integer\
 -1)
gap> Unbind\.(r, 2^1000);
Error, Record Unbind: <rnam> must be a positive small integer (not a large pos\
itive integer)
gap> Unbind\.(r, "a");
Error, Record Unbind: <rnam> must be a positive small integer (not a list (str\
ing))
gap> Unbind\.(r, 100000000);
Error, Record Unbind: <rnam> must be a valid rnam (not the integer 100000000)

##
gap> r;
rec(  )
gap> \.\:\=(r,RNamObj("y"), 2);
gap> r;
rec( y := 2 )
gap> \.\:\=(r,RNamObj("y"), 4);
gap> r;
rec( y := 4 )
gap> \.\:\=(r,RNamObj("x"), 5);
gap> r;
rec( x := 5, y := 4 )
gap> \.\:\=(r, 0, 1);
Error, Record Assignment: <rnam> must be a positive small integer (not the int\
eger 0)
gap> \.\:\=(r, -1, 1);
Error, Record Assignment: <rnam> must be a positive small integer (not the int\
eger -1)
gap> \.\:\=(r, 2^1000, 1);
Error, Record Assignment: <rnam> must be a positive small integer (not a large\
 positive integer)
gap> \.\:\=(r, "a", 1);
Error, Record Assignment: <rnam> must be a positive small integer (not a list \
(string))
gap> \.\:\=(r, 100000000, 1);
Error, Record Assignment: <rnam> must be a valid rnam (not the integer 1000000\
00)
gap> STOP_TEST("recordname.tst");
