����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
use strict;
use warnings;
use Test::Builder::Tester;
use Test::More 1;
use Test::File;
require "./t/setup_common";
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
my $file = 'min_file';
my $contents = do { open FH, $file; local $/; <FH> }; close FH;
my $pattern1 = 'x' x 11; $pattern1 = qr/(?mx:^ $pattern1 $)/;
my $pattern2 = 'x' x 40; $pattern2 = qr/(?mx:^ $pattern2 $)/;
my $bad_pattern = 'x' x 20; $bad_pattern = qr/(?mx:^ $bad_pattern $)/;
# like : single pattern
test_out( "ok 1 - min_file contains $pattern1" );
file_contains_like( $file, $pattern1 );
test_test();
test_out( "not ok 1 - bmoogle contains $pattern1" );
test_diag( 'file [bmoogle] does not exist' );
test_fail(+1);
file_contains_like( 'bmoogle', $pattern1 );
test_test();
SKIP: {
skip "Superuser has special privileges", 1 if is_unix_superuser();
skip "Windows has a different idea of readable", 1 if is_win32();
skip "Not possible to make file unreadable on MSYS", 1 if is_msys();
test_out( "not ok 1 - not_readable contains $pattern1" );
test_diag( 'file [not_readable] is not readable' );
test_fail(+1);
file_contains_like( 'not_readable', $pattern1 );
test_test();
}
test_out( "not ok 1 - min_file contains $bad_pattern" );
test_fail(+2);
like_diag($contents, $bad_pattern, "doesn't match");
file_contains_like( 'min_file', $bad_pattern );
test_test();
# unlike : single pattern
test_out( "ok 1 - min_file doesn't contain $bad_pattern" );
file_contains_unlike( $file, $bad_pattern );
test_test();
test_out( "not ok 1 - bmoogle doesn't contain $bad_pattern" );
test_diag( 'file [bmoogle] does not exist' );
test_fail(+1);
file_contains_unlike( 'bmoogle', $bad_pattern );
test_test();
SKIP: {
skip "Superuser has special privileges", 1 if is_unix_superuser();
skip "Windows has a different idea of readable", 1 if is_win32();
skip "Not possible to make file unreadable on MSYS", 1 if is_msys();
test_out( "not ok 1 - not_readable doesn't contain $bad_pattern" );
test_diag( 'file [not_readable] is not readable' );
test_fail(+1);
file_contains_unlike( 'not_readable', $bad_pattern );
test_test();
}
test_out( "not ok 1 - min_file doesn't contain $pattern1" );
test_fail(+2);
like_diag($contents, $pattern1, "matches");
file_contains_unlike( 'min_file', $pattern1 );
test_test();
# like : multiple patterns
test_out( "ok 1 - min_file contains $pattern1" );
test_out( "ok 2 - min_file contains $pattern2" );
file_contains_like( $file, [ $pattern1, $pattern2 ] );
test_test();
test_out( "ok 1 - file has the goods" );
test_out( "ok 2 - file has the goods" );
file_contains_like( $file, [ $pattern1, $pattern2 ], 'file has the goods' );
test_test();
test_out( "not ok 1 - bmoogle contains $pattern1" );
test_diag( 'file [bmoogle] does not exist' );
test_fail(+1);
file_contains_like( 'bmoogle', [ $pattern1, $pattern2 ] );
test_test();
SKIP: {
skip "Superuser has special privileges", 1 if is_unix_superuser();
skip "Windows has a different idea of readable", 1 if is_win32();
skip "Not possible to make file unreadable on MSYS", 1 if is_msys();
test_out( "not ok 1 - not_readable contains $pattern1" );
test_diag( 'file [not_readable] is not readable' );
test_fail(+1);
file_contains_like( 'not_readable', [ $pattern1, $pattern2 ] );
test_test();
}
test_out( "ok 1 - min_file contains $pattern1" );
test_out( "not ok 2 - min_file contains $bad_pattern" );
test_fail(+2);
like_diag($contents, $bad_pattern, "doesn't match");
file_contains_like( 'min_file', [ $pattern1, $bad_pattern ] );
test_test();
# unlike : multiple patterns
test_out( "ok 1 - min_file doesn't contain $bad_pattern" );
test_out( "ok 2 - min_file doesn't contain $bad_pattern" );
file_contains_unlike( $file, [ $bad_pattern, $bad_pattern ] );
test_test();
test_out( "ok 1 - file has the goods" );
test_out( "ok 2 - file has the goods" );
file_contains_unlike( $file, [ $bad_pattern, $bad_pattern ], 'file has the goods' );
test_test();
test_out( "not ok 1 - bmoogle doesn't contain $bad_pattern" );
test_diag( 'file [bmoogle] does not exist' );
test_fail(+1);
file_contains_unlike( 'bmoogle', [ $bad_pattern, $bad_pattern ] );
test_test();
SKIP: {
skip "Superuser has special privileges", 1 if is_unix_superuser();
skip "Windows has a different idea of readable", 1 if is_win32();
skip "Not possible to make file unreadable on MSYS", 1 if is_msys();
test_out( "not ok 1 - not_readable doesn't contain $bad_pattern" );
test_diag( 'file [not_readable] is not readable' );
test_fail(+1);
file_contains_unlike( 'not_readable', [ $bad_pattern, $bad_pattern ] );
test_test();
}
test_out( "ok 1 - min_file doesn't contain $bad_pattern" );
test_out( "not ok 2 - min_file doesn't contain $pattern1" );
test_fail(+2);
like_diag($contents, $pattern1, "matches");
file_contains_unlike( 'min_file', [ $bad_pattern, $pattern1 ] );
test_test();
done_testing();
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
sub like_diag {
my ($string, $pattern, $verb) = @_;
my $diag = ' ' x 18 . "'$string'\n";
$diag .= sprintf("%17s '%s'", $verb, $pattern);
$diag =~ s/^/# /mg;
test_err($diag);
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| rt | Folder | 0755 |
|
|
| dm_skeleton.t | File | 1.51 KB | 0644 |
|
| file_contains.t | File | 5.05 KB | 0644 |
|
| file_contains_encoded.t | File | 2.96 KB | 0644 |
|
| file_contains_utf8.t | File | 2.97 KB | 0644 |
|
| file_mtime.t | File | 3.02 KB | 0644 |
|
| file_sizes.t | File | 4.71 KB | 0644 |
|
| line_counters.t | File | 5.21 KB | 0644 |
|
| link_counts.t | File | 2.47 KB | 0644 |
|
| links.t | File | 5.23 KB | 0644 |
|
| load.t | File | 158 B | 0644 |
|
| normalize.t | File | 1.81 KB | 0644 |
|
| obviously_non_multi_user.t | File | 1.53 KB | 0644 |
|
| owner.t | File | 5.75 KB | 0644 |
|
| pod.t | File | 129 B | 0644 |
|
| pod_coverage.t | File | 161 B | 0644 |
|
| setup_common | File | 1.89 KB | 0644 |
|
| test_dirs.t | File | 1.42 KB | 0644 |
|
| test_files.t | File | 9.99 KB | 0644 |
|
| test_manifest | File | 282 B | 0644 |
|
| win32.t | File | 929 B | 0644 |
|