#!/usr/local/bin/perl -w =head1 NAME plugin.t - testing of VCP::Plugin services =cut use strict ; use Carp ; use Test ; use VCP::Plugin ; my $p ; sub flatten_spec { my ( $parsed_spec ) = @_ ; return join( ' ', map( defined $_ ? $_ : '-' , @$parsed_spec{qw( SCHEME USER PASSWORD SERVER FILES )} ) ) ; } my @repo_vectors = ( [ 'scheme:user:password@server:files', 'scheme user password server files' ], [ 'scheme:user:password@ser@:ver:files', 'scheme user password ser@:ver files' ], [ 'scheme:files', 'scheme - - - files' ], [ 'scheme:user@files', 'scheme - - - user@files' ], [ 'scheme:user@:files', 'scheme user - - files' ], ) ; my @tests = ( sub { $p = VCP::Plugin->new() ; ok( ref $p, 'VCP::Plugin' ) }, ## ## rev_root cleanup ## sub { $p->rev_root( '\\//foo\\//bar\\//' ) ; ok( $p->rev_root, 'foo/bar' )}, sub { $p->deduce_rev_root( '\\foo/bar/blah*blop/baz' ) ; ok( $p->rev_root, 'foo/bar' )}, sub { $p->deduce_rev_root( '\\foo/bar/blah?blop/baz' ) ; ok( $p->rev_root, 'foo/bar' )}, sub { $p->deduce_rev_root( '\\foo/bar/blah...blop/baz' ) ; ok( $p->rev_root, 'foo/bar' )}, ## ## Normalization & de-normalization ## sub { ok( $p->normalize_name( '/foo/bar/baz' ), 'baz' ) }, sub { eval {$p->normalize_name( '/foo/hmmm/baz' ) }, ok( $@ ) }, sub { ok( $p->denormalize_name( 'barf' ), 'foo/bar/barf' ) }, ( map { my ( $spec, $flattened ) = @$_ ; sub { ok( flatten_spec( $p->parse_repo_spec( $spec ) ), $flattened ) }, } @repo_vectors ), sub { $p->parse_repo_spec( 'scheme:user:password@server:files' ) ; ok( $p->repo_user, 'user' ) ; }, sub { ok( $p->repo_password, 'password' ) ; }, sub { ok( $p->repo_server, 'server' ) ; }, ) ; plan tests => scalar( @tests ) ; $_->() for @tests ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 1375 | Sean McCune | Creating my own branch for work on vcp. | ||
//guest/perforce_software/revml/t/00plugin.t | |||||
#2 | 468 | Barrie Slaymaker |
- VCP::Dest::p4 now does change number aggregation based on the comment field changing or whenever a new revision of a file with unsubmitted changes shows up on the input stream. Since revisions of files are normally sorted in time order, this should work in a number of cases. I'm sure we'll need to generalize it, perhaps with a time thresholding function. - t/90cvs.t now tests cvs->p4 replication. - VCP::Dest::p4 now doesn't try to `p4 submit` when no changes are pending. - VCP::Rev now prevents the same label from being applied twice to a revision. This was occuring because the "r_1"-style label that gets added to a target revision by VCP::Dest::p4 could duplicate a label "r_1" that happened to already be on a revision. - Added t/00rev.t, the beginnings of a test suite for VCP::Rev. - Tweaked bin/gentrevml to comment revisions with their change number instead of using a unique comment for every revision for non-p4 t/test-*-in-0.revml files. This was necessary to test cvs->p4 functionality. |
||
#1 | 467 | Barrie Slaymaker | Version 0.01, initial checkin in perforce public depot. |