MarpaX-ESLIF-URI

 view release on metacpan or  search on metacpan

t/file.t  view on Meta::CPAN

#!perl -T
use strict;
use warnings FATAL => 'all';
use Test::More;
use Test::Differences;
use Data::Dumper::OneLine qw/Dumper/;

BEGIN {
    use_ok( 'MarpaX::ESLIF::URI' ) || print "Bail out!\n";
}

my %DATA =
  (
   "file:///path/to/file" => {
                              scheme    => { origin => "file",                                 decoded => "file",                                 normalized => "file" },
                              string    => { origin => "file:///path/to/file",                 decoded => "file:///path/to/file",                 normalized => "file:///path/to/file" },
                              path      => { origin => "/path/to/file",                        decoded => "/path/to/file",                        normalized => "/path/to/file" },
                              segments  => { origin => ["path", "to", "file"],                 decoded => ["path", "to", "file"],                 normalized => ["path", "to", "file"] }
                             },
   "file:/path/to/file" => {
                              scheme    => { origin => "file",                                 decoded => "file",                                 normalized => "file" },
                              string    => { origin => "file:/path/to/file",                   decoded => "file:/path/to/file",                   normalized => "file:/path/to/file" },
                              path      => { origin => "/path/to/file",                        decoded => "/path/to/file",                        normalized => "/path/to/file" },
                              segments  => { origin => ["path", "to", "file"],                 decoded => ["path", "to", "file"],                 normalized => ["path", "to", "file"] }
                             },
   "file://host.example.com/path/to/file" => {
                              scheme    => { origin => "file",                                 decoded => "file",                                 normalized => "file" },
                              string    => { origin => "file://host.example.com/path/to/file", decoded => "file://host.example.com/path/to/file", normalized => "file://host.example.com/path/to/file" },
                              path      => { origin => "/path/to/file",                        decoded => "/path/to/file",                        normalized => "/path/to/file" },
                              segments  => { origin => ["path", "to", "file"],                 decoded => ["path", "to", "file"],                 normalized => ["path", "to", "file"] },
                              authority => { origin => "host.example.com",                     decoded => "host.example.com",                     normalized => "host.example.com" },
                              host      => { origin => "host.example.com",                     decoded => "host.example.com",                     normalized => "host.example.com" }
                             },
   "file:c:/path/to/file" => {
                              scheme    => { origin => "file",                                 decoded => "file",                                 normalized => "file" },
                              string    => { origin => "file:c:/path/to/file",                 decoded => "file:c:/path/to/file",                 normalized => "file:C:/path/to/file" },
                              drive     => { origin => "c",                                    decoded => "c",                                    normalized => "C" },
                              path      => { origin => "c:/path/to/file",                      decoded => "c:/path/to/file",                      normalized => "C:/path/to/file" },
                              segments  => { origin => ["c:", "path", "to", "file"],           decoded => ["c:", "path", "to", "file"],           normalized => ["C:", "path", "to", "file"] }
                             },
   "file:///c:/path/to/file" => {
                              scheme    => { origin => "file",                                 decoded => "file",                                 normalized => "file" },
                              string    => { origin => "file:///c:/path/to/file",              decoded => "file:///c:/path/to/file",              normalized => "file:///C:/path/to/file" },
                              drive     => { origin => "c",                                    decoded => "c",                                    normalized => "C" },
                              path      => { origin => "/c:/path/to/file",                     decoded => "/c:/path/to/file",                     normalized => "/C:/path/to/file" },
                              segments  => { origin => ["c:", "path", "to", "file"],           decoded => ["c:", "path", "to", "file"],           normalized => ["C:", "path", "to", "file"] }
                             },
   "file:/c:/path/to/file" => {
                              scheme    => { origin => "file",                                 decoded => "file",                                 normalized => "file" },
                              string    => { origin => "file:/c:/path/to/file",                decoded => "file:/c:/path/to/file",                normalized => "file:/C:/path/to/file" },
                              drive     => { origin => "c",                                    decoded => "c",                                    normalized => "C" },
                              path      => { origin => "/c:/path/to/file",                     decoded => "/c:/path/to/file",                     normalized => "/C:/path/to/file" },
                              segments  => { origin => ["c:", "path", "to", "file"],           decoded => ["c:", "path", "to", "file"],           normalized => ["C:", "path", "to", "file"] }
                             },
   "file:c|/path/to/file" => {
                              scheme    => { origin => "file",                                 decoded => "file",                                 normalized => "file" },
                              string    => { origin => "file:c|/path/to/file",                 decoded => "file:c|/path/to/file",                 normalized => "file:C|/path/to/file" },
                              drive     => { origin => "c",                                    decoded => "c",                                    normalized => "C" },
                              path      => { origin => "c|/path/to/file",                      decoded => "c|/path/to/file",                      normalized => "C|/path/to/file" },
                              segments  => { origin => ["c|", "path", "to", "file"],           decoded => ["c|", "path", "to", "file"],           normalized => ["C|", "path", "to", "file"] }
                             },
   "file:///c|/path/to/file" => {
                              scheme    => { origin => "file",                                 decoded => "file",                                 normalized => "file" },
                              string    => { origin => "file:///c|/path/to/file",              decoded => "file:///c|/path/to/file",              normalized => "file:///C|/path/to/file" },
                              drive     => { origin => "c",                                    decoded => "c",                                    normalized => "C" },



( run in 2.297 seconds using v1.01-cache-2.11-cpan-99c4e6809bf )