Skip to content

Commit

Permalink
more realistic split_header tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 2, 2014
1 parent aa003af commit f6f52e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/mojo/util.t
Expand Up @@ -81,9 +81,9 @@ $tree = [
]
];
is_deeply split_header($header), $tree, 'right result';
my $cb = sub { substr(${$_[0]}, 0, 3, ''), undef };
is_deeply split_header('', $cb), [['', undef]], 'right result';
$header = q{f;o; bar=baz, b,z; yada="a b c"};
my $cb = sub { ${$_[0]} =~ s/^\s*<(.+?)>// ? ($1, undef) : () };
is_deeply split_header('', $cb), [], 'right result';
$header = q{<f;o>; bar=baz, <b,z>; yada="a b c"};
$tree = [['f;o', undef, 'bar', 'baz'], ['b,z', undef, 'yada', 'a b c']];
is_deeply split_header($header, $cb), $tree, 'right result';

Expand Down

0 comments on commit f6f52e3

Please sign in to comment.