File Coverage: t/09-tr4h2o.t

# File Coverage

File: | t/09-tr4h2o.t
Coverage: | 100.0%

line | stmt | bran | cond | sub | pod | time | code
--- | --- | --- | --- | --- | --- | --- | ---
1 |  |  |  |  |  |  | #!/usr/bin/env perl
2 |
3 | 1 1 1 |  |  | 1 |  | 2846 1 24 | use strict;
4 | 1 1 1 |  |  | 1 |  | 3 1 31 | use warnings;
5 | 1 1 1 |  |  | 1 |  | 344 70294 6 | use Test::More;
6 | 1 1 1 |  |  | 1 |  | 584 2 1072 | use Util::H2O::More qw/h2o tr4h2o/;
7 |
8 | 1 |  |  |  |  | 70274 | my $hash = { "foo bar" => 123, "quz-ba%z" => 456 };
9 | 1 |  |  |  |  | 3 | my $obj = h2o tr4h2o $hash;
10 |
11 | 1 |  |  |  |  | 128 | is $obj->foo_bar, 123, q{tr4h2o made accessor compliant as expected};
12 | 1 |  |  |  |  | 321 | is $obj->quz_ba_z, 456, q{tr4h2o made accessor compliant as expected};
13 |
14 | 1 |  |  |  |  | 258 | my $og_keys = $obj->__og_keys;
15 | 1 |  |  |  |  | 7 | is ref $og_keys, q{HASH}, q{__og_keys returns HASH ref};
16 | 1 |  |  |  |  | 243 | is $og_keys->{foo_bar}, q{foo bar}, q{original key 'foo bar' preserved via '__og_keys'};
17 | 1 |  |  |  |  | 241 | is $og_keys->{quz_ba_z}, q{quz-ba%z}, q{original key 'qaz-ba%z' preserved via '__og_keys'};
18 |
19 | 1 |  |  |  |  | 238 | done_testing;