1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
package Test::Files::Constants;
our $VERSION = '0.26'; ## no critic (RequireUseStrict, RequireUseWarnings)
use strict;
use warnings
FATAL => qw( all ),
NONFATAL => qw( deprecated exec internal malloc newline portable recursion );
use Const::Fast qw( const );
use Exporter qw( import );
use PadWalker qw( peek_our );
const our $DIRECTORY_OPTIONS => {
EXISTENCE_ONLY => 0,
FILTER => undef,
NAME_PATTERN => '.',
RECURSIVE => 0,
SIZE_ONLY => 0,
SYMMETRIC => 0,
};
const our $ARCHIVE_OPTIONS => {
%$DIRECTORY_OPTIONS,
EXTRACT => sub {},
META_DATA => sub {},
};
const our $FILE_OPTIONS => {
EXISTENCE_ONLY => 0,
FILTER => undef,
SIZE_ONLY => 0,
};
const our $EXPECTED_CONTENT => '<expected content>';
const our $FMT_ABSENT => "'%s' is absent, or is a directory, or is a special file";
const our $FMT_ABSENT_WITH_ERROR => "'%s' is absent, error: %s";
const our $FMT_CANNOT_CREATE_DIR => "Cannot create directory '%s': %s";
const our $FMT_CANNOT_EXTRACT => "Cannot extract from '%s' to directory '%s': %s";
const our $FMT_CANNOT_GET_METADATA => "Cannot get metadata from '%s': %s";
const our $FMT_DIFFERENT_SIZE => "'%s' and '%s' have different sizes: %d and %d bytes, correspondingly";
const our $FMT_FAILED_TO_SEE => "Failed to see '%s'";
const our $FMT_FILTER_ISNT_CODEREF => "Filter supplied to '%s' must be a code reference (or undef)";
const our $FMT_FIRST_FILE_ABSENT => "'%s' is present but '%s' is absent";
const our $FMT_INVALID_ARGUMENT => "'%s' requires %s as %s argument";
const our $FMT_INVALID_DIR => "'%s' is not a valid directory";
const our $FMT_INVALID_NAME_PATTER => "Name pattern '%s' supplied to '%s' is invalid: %s";
const our $FMT_INVALID_OPTIONS => "Invalid options detected: '%s'";
const our $FMT_SECOND_FILE_ABSENT => "'%s' is absent but '%s' is present";
const our $FMT_SUB_FAILED => "Passed subroutine failed for '%s'";
const our $FMT_UNDEF => "Argument '%s' of '%s' must be a string or a Path::Tiny object";
const our $FMT_UNEXPECTED => "Unexpectedly saw: '%s'";
const our $UNKNOWN => '<unknown>';
const our %DIFF_OPTIONS => (
CONTEXT => 3, # change this one later if needed
FILENAME_A => 'Got',
FILENAME_B => 'Expected',
INDEX_LABEL => 'Ln',
KEYGEN => undef,
KEYGEN_ARGS => undef,
MTIME_A => undef,
MTIME_B => undef,
OFFSET_A => 1,
OFFSET_B => 1,
OUTPUT => undef,
STYLE => 'Unified',
);
push( our @EXPORT_OK, keys( %{ peek_our( 0 ) } ) );
1;
|