#############################################################################
##
#W  extend.tst          GAP 4 package `atlasrep'                Thomas Breuer
##
#H  @(#)$Id: extend.tst,v 1.14 2003/09/22 16:36:42 gap Exp $
##
#Y  Copyright (C)  2002,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
##
##  These tests can be executed only if `ls' is available.
##
gap> START_TEST("$Id: extend.tst,v 1.14 2003/09/22 16:36:42 gap Exp $");


# Test whether the system progran `ls' is available.
gap> if Filename( DirectoriesSystemPrograms(), "ls" ) = fail then
>      Print( "#E  Omit `extend.tst', since `ls' is not available.\n" );
> fi;

# Load the package if necessary.
gap> LoadPackage( "atlasrep" );
true
gap> LoadPackage( "ctbllib" );
true
gap> level:= InfoLevel( InfoAtlasRep );;
gap> SetInfoLevel( InfoAtlasRep, 1 );

# Create files in a private directory.
gap> pkg:= Filename( DirectoriesPackageLibrary( "atlasrep", "" ), "" );;
gap> prv:= Filename( Directory( pkg ), "privdir" );;
gap> if IsExistingFile( prv ) <> true then
>      Exec( Concatenation( "mkdir ", prv ) );
>    fi;
gap> priv:= Filename( Directory( prv ), "C4" );;
gap> if IsExistingFile( priv ) <> true then
>      Exec( Concatenation( "mkdir ", priv ) );
>    fi;
gap> privdir:= Directory( priv );;
gap> PrintTo( Filename( privdir, "C4G1-p4B0.m1" ),
>             MeatAxeString( [ (1,2,3,4) ], 4 ) );
gap> PrintTo( Filename( privdir, "C4G1-max1W1" ),
>             "inp 1\npwr 2 1 2\noup 1 2\n" );
gap> PrintTo( Filename( privdir, "C4G1-XtestW1" ),
>             "inp 1\npwr 2 1 2\noup 1 2\n" );
gap> PrintTo( Filename( privdir, "C4G1-a2W1" ),
>             "inp 1\npwr 3 1 2\noup 1 2\n" );
gap> PrintTo( Filename( privdir, "C4G1-Ar1aB0.g" ),
>             "return rec( generators:= [ [[E(4)]] ] );\n" );
gap> priv:= Filename( Directory( prv ), "S5" );;
gap> if IsExistingFile( priv ) <> true then
>      Exec( Concatenation( "mkdir ", priv ) );
>    fi;
gap> privdir:= Directory( priv );;
gap> PrintTo( Filename( privdir, "S5G1-p2B0.m1" ),
>             MeatAxeString( [ (1,2) ], 2 ) );
gap> PrintTo( Filename( privdir, "S5G1-p2B0.m2" ),
>             MeatAxeString( [ (1,2) ], 2 ) );
gap> PrintTo( Filename( privdir, "S5G1-p5B0.m1" ),
>             MeatAxeString( [ (1,2) ], 5 ) );

# Notify the name of `C4'.
gap> PrintTo( Filename( Directory( prv ), "toc.g" ),
>             "AGRGNAN(\"C4\",\"C4\");\n" );

# Notify the private directory.
gap> AtlasOfGroupRepresentationsNotifyPrivateDirectory( prv, "priv" );
#I  file `[ "S5G1-p5B0.m1", "S5G1-p5B0.m2" ]' was already in another t.o.c.
false

# Use the files in the private directory.
gap> DisplayAtlasInfo( [ "C4" ] );
group    #  maxes  cl  cyc  out
-------------------------------
C4*      2      1   -    -    2
gap> DisplayAtlasInfo( "C4" );
Representations for G = C4:    (all refer to std. generators 1)
---------------------------
1: G <= Sym(4)*
2: G <= GL(1a,C)*

Straight line programs for G = C4:    (all refer to std. generators 1)
----------------------------------
available maxes of G:  [ 1 ]*
available automorphisms:  [ "2" ]*
available other scripts:  [ "test" ]*
gap> DisplayAtlasInfo( "C4", IsPermGroup );
Representations for G = C4:    (all refer to std. generators 1)
---------------------------
1: G <= Sym(4)*
gap> DisplayAtlasInfo( "C4", IsMatrixGroup );
Representations for G = C4:    (all refer to std. generators 1)
---------------------------
2: G <= GL(1a,C)*
gap> DisplayAtlasInfo( "C4", Dimension, 2 );
gap> DisplayAtlasInfo( "A5.2", NrMovedPoints, 2 );
Representations for G = A5.2:    (all refer to std. generators 1)
-----------------------------
4: G <= Sym(2)*
gap> DisplayAtlasInfo( "J5" );
#I  DisplayAtlasInfo: no group with GAP name `J5'

gap> OneAtlasGeneratingSet( "C4" );
rec( generators := [ (1,2,3,4) ], standardization := 1, 
  identifier := [ [ "priv", "C4" ], [ "C4/C4G1-p4B0.m1" ], 1, 4 ] )
gap> AtlasStraightLineProgram( "C4", 1 );
rec( program := <straight line program>, standardization := 1, 
  identifier := [ [ "priv", "C4" ], "C4/C4G1-max1W1", 1 ] )
gap> AtlasStraightLineProgram( "C4", "maxes", 1 );
rec( program := <straight line program>, standardization := 1, 
  identifier := [ [ "priv", "C4" ], "C4/C4G1-max1W1", 1 ] )
gap> AtlasStraightLineProgram( "C4", "maxes", 2 );
fail
gap> AtlasGenerators( "C4", 1 );
rec( generators := [ (1,2,3,4) ], standardization := 1, 
  identifier := [ [ "priv", "C4" ], [ "C4/C4G1-p4B0.m1" ], 1, 4 ] )
gap> AtlasGenerators( "C4", 2 );
rec( generators := [ [ [ E(4) ] ] ], standardization := 1, 
  identifier := [ [ "priv", "C4" ], "C4/C4G1-Ar1aB0.g", 1, 1 ] )
gap> AtlasGenerators( "C4", 3 );
fail
gap> AtlasStraightLineProgram( "C4", "other", "test" );
rec( program := <straight line program>, standardization := 1,
  identifier := [ [ "priv", "C4" ], "C4/C4G1-XtestW1", 1 ] )

# Run the standard tests for the private directory.
gap> AtlasOfGroupRepresentationsTestWords( "priv" );
#I  no character table for `C4M1', no check for `C4/C4G1-max1W1'
true
gap> AtlasOfGroupRepresentationsTestFileHeaders( "priv" );
true

# Remove the private directory.
gap> AtlasOfGroupRepresentationsForgetPrivateDirectory( "priv" );
gap> Exec( Concatenation( "rm -rf ", prv ) );

# Reset the info level which was set to `1' in the beginning.
gap> SetInfoLevel( InfoAtlasRep, level );


gap> STOP_TEST( "extend.tst", 10000000 );


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

