Skip to content

Commit

Permalink
even more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 3, 2011
1 parent 0cfa81a commit 1022b55
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion t/mojo/path.t
@@ -1,7 +1,9 @@
#!/usr/bin/env perl
use Mojo::Base -strict;

use Test::More tests => 91;
use utf8;

use Test::More tests => 105;

# "This is the greatest case of false advertising I’ve seen since I sued the
# movie 'The Never Ending Story.'"
Expand All @@ -20,6 +22,24 @@ is $path->parts->[1], undef, 'no part';
is $path->leading_slash, undef, 'no leading slash';
is $path->trailing_slash, 1, 'has trailing slash';

# Unicode
is $path->parse('/foo/♥/bar')->to_string, '/foo/%E2%99%A5/bar',
'right path';
is $path->parts->[0], 'foo', 'right part';
is $path->parts->[1], '', 'right part';
is $path->parts->[2], 'bar', 'right part';
is $path->parts->[3], undef, 'no part';
is $path->leading_slash, 1, 'has leading slash';
is $path->trailing_slash, undef, 'no trailing slash';
is $path->parse('/foo/%E2%99%A5/bar')->to_string, '/foo/%E2%99%A5/bar',
'right path';
is $path->parts->[0], 'foo', 'right part';
is $path->parts->[1], '', 'right part';
is $path->parts->[2], 'bar', 'right part';
is $path->parts->[3], undef, 'no part';
is $path->leading_slash, 1, 'has leading slash';
is $path->trailing_slash, undef, 'no trailing slash';

# Zero in path
is $path->parse('/path/0')->to_string, '/path/0', 'right path';
is $path->parts->[0], 'path', 'right part';
Expand Down

0 comments on commit 1022b55

Please sign in to comment.