"Fossies" - the Fresh Open Source Software Archive

Member "MIME-Types-2.22/t/11typeol.t" (9 Dec 2020, 826 Bytes) of package /linux/privat/MIME-Types-2.22.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/env perl
    2 #
    3 # Test overloading on MIME::Type objects.
    4 #
    5 
    6 use strict;
    7 use warnings;
    8 
    9 use lib qw(lib t);
   10 
   11 use Test::More tests => 21;
   12 
   13 use MIME::Type;
   14 
   15 my $a = MIME::Type->new(type => 'x-appl/x-zip');
   16 my $b = MIME::Type->new(type => 'appl/x-zip');
   17 my $c = MIME::Type->new(type => 'x-appl/zip');
   18 my $d = MIME::Type->new(type => 'appl/zip');
   19 my $e = MIME::Type->new(type => 'text/plain');
   20 
   21 ok($a eq $b);
   22 ok($a eq $c);
   23 ok($a eq $d);
   24 ok($b eq $c);
   25 ok($b eq $d);
   26 ok($c eq $d);
   27 ok($a ne $e);
   28 
   29 ok(!$a->isRegistered);
   30 ok(!$b->isRegistered);
   31 ok(!$c->isRegistered);
   32 ok( $d->isRegistered);
   33 ok( $e->isRegistered);
   34 
   35 is("$a", 'x-appl/x-zip');
   36 is("$b", 'appl/x-zip');
   37 is("$c", 'x-appl/zip');
   38 is("$d", 'appl/zip');
   39 is("$e", 'text/plain');
   40 
   41 ok($a eq 'appl/zip');
   42 ok($b eq 'APPL/ZIP');
   43 ok($c eq 'x-appl/x-zip');
   44 ok($e eq 'text/plain');