#!/usr/local/bin/perl -w =head1 NAME 02source.t - testing of VCP::Source services =cut use strict ; use Carp ; use Test ; use VCP::Source; my $p ; sub f { my @f = reverse( (localtime shift)[0..5] ) ; $f[0] += 1900 ; $f[1] ++ ; ## Month of year needs to be 1..12 return sprintf( "%04d-%02d-%02d %02d:%02d:%02d", @f ) ; } sub pt { return f $p->parse_time( @_ ); } my @tests = ( sub { $p = VCP::Source->new() ; ok ref $p, 'VCP::Source'; }, sub { $p->bootstrap( "foo" ); ok join( " ", map "'$_'", $p->options_as_strings ), qr/'--bootstrap=foo'/; }, sub { ok pt( "2000-01-01 00:00:00" ), "2000-01-01 00:00:00" }, sub { ok pt( "2000-01-01 00:00 " ), "2000-01-01 00:00:00" }, sub { ok pt( "2000-01-01 " ), "2000-01-01 00:00:00" }, sub { ok pt( "2000-01-01 12:00:00 AM" ), "2000-01-01 00:00:00" }, sub { ok pt( "2000-01-01 01:00:00 AM" ), "2000-01-01 01:00:00" }, sub { ok pt( "2000-01-01 11:00:00 AM" ), "2000-01-01 11:00:00" }, sub { ok pt( "2000-01-01 12:00:00 PM" ), "2000-01-01 12:00:00" }, sub { ok pt( "2000-01-01 01:00:00 PM" ), "2000-01-01 13:00:00" }, sub { ok pt( "2000-01-01 11:00:00 PM" ), "2000-01-01 23:00:00" }, sub { ok pt( "2000-01-01 12:00:00 A" ), "2000-01-01 00:00:00" }, sub { ok pt( "2000-01-01 01:00:00 A" ), "2000-01-01 01:00:00" }, sub { ok pt( "2000-01-01 11:00:00 A" ), "2000-01-01 11:00:00" }, sub { ok pt( "2000-01-01 12:00:00 P" ), "2000-01-01 12:00:00" }, sub { ok pt( "2000-01-01 01:00:00 P" ), "2000-01-01 13:00:00" }, sub { ok pt( "2000-01-01 11:00:00 P" ), "2000-01-01 23:00:00" }, sub { ok pt( "2000-01-01 12:00:00AM" ), "2000-01-01 00:00:00" }, sub { ok pt( "2000-01-01 01:00:00AM" ), "2000-01-01 01:00:00" }, sub { ok pt( "2000-01-01 11:00:00AM" ), "2000-01-01 11:00:00" }, sub { ok pt( "2000-01-01 12:00:00PM" ), "2000-01-01 12:00:00" }, sub { ok pt( "2000-01-01 01:00:00PM" ), "2000-01-01 13:00:00" }, sub { ok pt( "2000-01-01 11:00:00PM" ), "2000-01-01 23:00:00" }, sub { ok pt( "2000-01-01 12:00:00A" ), "2000-01-01 00:00:00" }, sub { ok pt( "2000-01-01 01:00:00A" ), "2000-01-01 01:00:00" }, sub { ok pt( "2000-01-01 11:00:00A" ), "2000-01-01 11:00:00" }, sub { ok pt( "2000-01-01 12:00:00P" ), "2000-01-01 12:00:00" }, sub { ok pt( "2000-01-01 01:00:00P" ), "2000-01-01 13:00:00" }, sub { ok pt( "2000-01-01 11:00:00P" ), "2000-01-01 23:00:00" }, sub { ok pt( "2000-01-01 23:54:29 +0000" ), "2000-01-01 23:54:29" }, sub { ok pt( "2006-03-08T21:24:59.015625Z" ), "2006-03-08 21:24:59" }, ) ; plan tests => scalar( @tests ) ; $_->() for @tests ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 6118 | Dimitry Andric | Integ from //public/revml to //guest/dimitry_andric/revml/main. | ||
//guest/perforce_software/revml/t/02source.t | |||||
#5 | 5404 | Barrie Slaymaker |
- SVN support added - Makefile gives clearer notices about missing optional prereqs. - VCP::Filter::labelmap and VCP::Filter::map: <<skip>> replaces deprecated <<delete>> to be clearer that no revisions are deleted from either repository but some just are skipped and not inserted. - VCP::Filter::map: support added for SVN-like branch labels - VCP::Source: support added for ISO8601 timestamps emitted by SVN. |
||
#4 | 5344 | Barrie Slaymaker | - Add test for time parsing fixed bug in VCP::Source. | ||
#3 | 4135 | Barrie Slaymaker | - Time fields may have trailing AM/PM or A/P without leading whitespace | ||
#2 | 4134 | Barrie Slaymaker |
- "AM", "PM", "A", and "P" (case insensitive) are now parsed properly when parsing time values |
||
#1 | 3460 | Barrie Slaymaker |
- Revamp Plugin/Source/Dest hierarchy to allow for reguritating options in to .vcp files |