use Test::More tests => 15;
BEGIN { use_ok( 'P4' ); }
# Load test utils
unshift( @INC, "." );
unshift( @INC, "t" );
require_ok( "p4test" );
my $test = new P4::Test;
my $p4 = $test->InitClient();
ok( defined( $p4 ) );
$p4->SetClient( "someclientname" );
ok( $p4->GetClient() eq "someclientname" );
$p4->SetProg( $0 );
is( $p4->GetProg(), $0 );
$p4->SetVersion( "v1.0" );
is( $p4->GetVersion(), "v1.0" );
$p4->SetLanguage( "en" );
is( $p4->GetLanguage(), "en" );
$p4->SetLanguage( "" );
#
# Test getting and setting resource limits
#
$p4->SetMaxResults( 10000 );
$p4->SetMaxScanRows( 10000 );
$p4->SetMaxLockTime( 10000 );
is( $p4->GetMaxResults(), 10000 );
is( $p4->GetMaxScanRows(), 10000 );
is( $p4->GetMaxLockTime(), 10000 );
$p4->SetTicketFile( $test->ClientRoot() . "/.p4tickets" );
is( $p4->GetTicketFile(), $test->ClientRoot() . "/.p4tickets" );
# Should be a P4CONFIG file since CreateTestTree() creates one.
ok( $p4->P4ConfigFile() ne "" );
ok( $p4->Connect() );
@info = $p4->RunInfo();
ok( length( @info ) == 1 );
ok( $info[0]->{ 'clientName' } eq "*unknown*" );