#!/usr/local/bin/perl -w =head1 NAME 00utils_p4.t - testing of VCP::Utils::p4 =cut use strict ; use Carp ; use Test ; use VCP::Utils::p4 qw( p4_get_settings ); my @tests = ( sub { ok VCP::Utils::p4::underscorify_name( "a" ), "a" }, sub { ok VCP::Utils::p4::underscorify_name( "ab" ), "ab" }, sub { ok VCP::Utils::p4::underscorify_name( "a1" ), "a1" }, sub { ok VCP::Utils::p4::underscorify_name( "a(" ), "a(" }, sub { ok VCP::Utils::p4::underscorify_name( "a/" ), "a/" }, sub { ok VCP::Utils::p4::underscorify_name( "a b"), "a_20_b" }, sub { ok VCP::Utils::p4::underscorify_name( "a#b"), "a_23_b" }, sub { ok VCP::Utils::p4::underscorify_name( "a\@b"), "a_40_b" }, sub { ok VCP::Utils::p4::underscorify_name( " a" ), "_20_a" }, sub { $ENV{P4EDITOR} = 'vituperated_eczema'; my $h = p4_get_settings; ok $h->{P4EDITOR}, 'vituperated_eczema'; }, ) ; plan tests => scalar( @tests ) ; $_->() for @tests ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 3635 | Barrie Slaymaker |
- Skip test on Win32 because P4USER in registry seems to override P4USER= in P4CONFIG |
||
#3 | 3570 | John Fetkovich |
change p4_get_settings (wrapper around 'p4 set' command) to remove parenthesized things at the end of a line which indicate where a value came from (such as a config file) |
||
#2 | 3508 | John Fetkovich |
added p4_get_settings sub to read P4... env vars/config settings |
||
#1 | 2692 | Barrie Slaymaker |
Centralize escaping of p4 label (etc) names. NOTE: I have not been able to find a description of the set of legal p4 names (namelength, character set, etc). This is purely a first attempt, if you have details on this, please let me know. |