Add ARM files
[dh-make-perl] / dev / arm / liburi-perl / liburi-perl-1.35.dfsg.1 / t / split.t
1 #!perl -w
2
3 print "1..17\n";
4
5 use strict;
6 use URI::Split qw(uri_split uri_join);
7
8 sub j { join("-", map { defined($_) ? $_ : "<undef>" } @_) }
9
10 print "not " unless j(uri_split("p")) eq "<undef>-<undef>-p-<undef>-<undef>";
11 print "ok 1\n";
12
13 print "not " unless j(uri_split("p?q")) eq "<undef>-<undef>-p-q-<undef>";
14 print "ok 2\n";
15
16 print "not " unless j(uri_split("p#f")) eq "<undef>-<undef>-p-<undef>-f";
17 print "ok 3\n";
18
19 print "not " unless j(uri_split("p?q/#f/?")) eq "<undef>-<undef>-p-q/-f/?";
20 print "ok 4\n";
21
22 print "not " unless j(uri_split("s://a/p?q#f")) eq "s-a-/p-q-f";
23 print "ok 5\n";
24
25 print "not " unless uri_join("s", "a", "/p", "q", "f") eq "s://a/p?q#f";
26 print "ok 6\n";
27
28 print "not " unless uri_join("s", "a", "p", "q", "f") eq "s://a/p?q#f";
29 print "ok 7\n";
30
31 print "not " unless uri_join(undef, undef, "", undef, undef) eq "";
32 print "ok 8\n";
33
34 print "not " unless uri_join(undef, undef, "p", undef, undef) eq "p";
35 print "ok 9\n";
36
37 print "not " unless uri_join("s", undef, "p") eq "s:p";
38 print "ok 10\n";
39
40 print "not " unless uri_join("s") eq "s:";
41 print "ok 11\n";
42
43 print "not " unless uri_join() eq "";
44 print "ok 12\n";
45
46 print "not " unless uri_join("s", "a") eq "s://a";
47 print "ok 13\n";
48
49 print "not " unless uri_join("s", "a/b") eq "s://a%2Fb";
50 print "ok 14\n";
51
52 print "not " unless uri_join("s", ":/?#", ":/?#", ":/?#", ":/?#") eq "s://:%2F%3F%23/:/%3F%23?:/?%23#:/?#";
53 print "ok 15\n";
54
55 print "not " unless uri_join(undef, undef, "a:b") eq "a%3Ab";
56 print "ok 16\n";
57
58 print "not " unless uri_join("s", undef, "//foo//bar") eq "s:////foo//bar";
59 print "ok 17\n";