~ubuntu-branches/ubuntu/vivid/libspoon-perl/vivid

« back to all changes in this revision

Viewing changes to t/cgi.t

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Krzyżaniak (eloy), Krzysztof Krzyżaniak (eloy), gregor herrmann
  • Date: 2008-07-01 10:38:36 UTC
  • mfrom: (1.1.2 upstream) (3.1.1 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080701103836-04om5jc04qt53mt0
Tags: 0.24-1
[ Krzysztof Krzyżaniak (eloy) ]
* New upstream release
* debian/watch: remove uupdate part
* debian/control:
 + Standards-Version updated to 3.8.0 (without any changes)
 + Uploaders: added me
 + BuildDepends: increase dependency for debhelper to (>= 7)
* debian/rules: used debhelper 7 simple example
* debian/compat: increase to 7 (without any changes)

[ gregor herrmann <gregoa@debian.org> ]
* Take over for the Debian Perl Group with maintainer's permission
  (http://lists.debian.org/debian-perl/2008/06/msg00039.html)
* debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
  field (source stanza); Homepage field (source stanza). Changed:
  Maintainer set to Debian Perl Group <pkg-perl-
  maintainers@lists.alioth.debian.org> (was: Florian Ragwitz
  <rafl@debian.org>); Florian Ragwitz <rafl@debian.org> moved to
  Uploaders.
* debian/watch: use dist-based URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
use warnings;
4
4
use Test::More;
5
5
 
6
 
use Encode;
 
6
eval "use Encode";
 
7
my $enc = ! $@;
 
8
 
7
9
use Spoon::CGI;
8
10
use URI::Escape;
9
11
 
25
27
    $ENV{QUERY_STRING} = "param1=2;foo=bar";
26
28
 
27
29
    my $test1 = Test1->new;
28
 
    ok( Encode::is_utf8($test1->param1), 'param1 is marked as utf8' );
 
30
    SKIP: {
 
31
        skip "Encode not installed", 1  unless($enc);
 
32
        ok( Encode::is_utf8($test1->param1), 'param1 is marked as utf8' );
 
33
    }
 
34
 
29
35
    is( $test1->param1, 2, 'param1 value is 2' );
30
36
}
31
37
 
35
41
    $ENV{QUERY_STRING} = 'param1=%E1%9A%A0%E1%9B%87%E1%9A%BB;foo=bar';
36
42
 
37
43
    my $test1 = Test1->new;
38
 
    ok( Encode::is_utf8($test1->param1), 'param1 is marked as utf8' );
 
44
    SKIP: {
 
45
        skip "Encode not installed", 1  unless($enc);
 
46
        ok( Encode::is_utf8($test1->param1), 'param1 is marked as utf8' );
 
47
    }
 
48
 
39
49
    is( $test1->param1, "\x{16A0}\x{16C7}\x{16BB}",
40
50
        'param1 value is \x{16A0}\x{16C7}\x{16BB}' );
41
51
}
46
56
    $ENV{QUERY_STRING} = 'param2=%E1%9A%A0%E1%9B%87%E1%9A%BB;foo=bar';
47
57
 
48
58
    my $test1 = Test1->new;
49
 
    ok( Encode::is_utf8($test1->param2), 'param2 is marked as utf8' );
 
59
    SKIP: {
 
60
        skip "Encode not installed", 1  unless($enc);
 
61
        ok( Encode::is_utf8($test1->param2), 'param2 is marked as utf8' );
 
62
    }
 
63
 
50
64
    is( $test1->param2, "\x{16A0}\x{16C7}\x{16BB}",
51
65
        'param2 value is \x{16A0}\x{16C7}\x{16BB}' );
52
66
}
57
71
    $ENV{QUERY_STRING} = 'trimmed=%20%20trim%20me%20%20;foo=bar';
58
72
 
59
73
    my $test1 = Test1->new;
60
 
    ok( Encode::is_utf8($test1->trimmed), 'trimmed is marked as utf8' );
 
74
    SKIP: {
 
75
        skip "Encode not installed", 1  unless($enc);
 
76
        ok( Encode::is_utf8($test1->trimmed), 'trimmed is marked as utf8' );
 
77
    }
 
78
 
61
79
    is( $test1->trimmed, "trim me",
62
80
        'trimmed value is "trim me"' );
63
81
}
68
86
    $ENV{QUERY_STRING} = 'nl=line1%0d%0aline2%0dline3;foo=bar';
69
87
 
70
88
    my $test1 = Test1->new;
71
 
    ok( Encode::is_utf8($test1->nl), 'nl is marked as utf8' );
 
89
    SKIP: {
 
90
        skip "Encode not installed", 1  unless($enc);
 
91
        ok( Encode::is_utf8($test1->nl), 'nl is marked as utf8' );
 
92
    }
 
93
 
72
94
    is( $test1->nl, "line1\nline2\nline3\n",
73
95
        'nl only contains unix newlines' );
74
96
}