File: 05-null.t

package info (click to toggle)
liburi-escape-xs-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 144 kB
  • ctags: 3
  • sloc: perl: 239; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!perl -w
#
# $Id: 05-null.t,v 1.1 2009/10/07 11:40:30 dankogai Exp $
#
# https://rt.cpan.org/Ticket/Display.html?id=45855

use URI::Escape::XS;
use Test::More tests => 6;

{
    no warnings 'uninitialized';
    my $d;
    is encodeURIComponent($d) => '', 'encodeURIComponent(null)';
    is decodeURIComponent($d) => '', 'decodeURIComponent(null)';
}

$d = '';
is length(encodeURIComponent($d)) => 0, 'length encodeURIComponent(\'\')';
is defined(encodeURIComponent($d)) => 1, 'defined encodeURIComponent(\'\')';
is length(decodeURIComponent($d)) => 0, 'length decodeURIComponent(\'\')';
is defined(decodeURIComponent($d)) => 1, 'defined decodeURIComponent(\'\')';