X-Git-Url: http://git.shiar.net/gitweb.cgi/perl/plp/.git/blobdiff_plain/55b5d8b2c5b2d13e40ed37f37ef54f0e1f37af4b..123b0af80086cfc59726208a2cb390b6532f5036:/test.pl?ds=inline
diff --git a/test.pl b/test.pl
index ee6478e..a6c6e92 100644
--- a/test.pl
+++ b/test.pl
@@ -1,20 +1,38 @@
-
-# TODO - Write tests.
-
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl test.pl'
-
-#########################
-
-# change 'tests => 1' to 'tests => last_test_to_print';
-
-use Test;
-BEGIN { plan tests => 1 };
-use PLP;
-ok(1); # If we made it this far, we're ok.
-
-#########################
-
-# Insert your test code below, the Test module is use()ed here so read
-# its man page ( perldoc Test ) for help writing this test script.
+use strict;
+
+use Test::More tests => 6;
+
+BEGIN { use_ok('PLP') }
+
+PLP::Functions->import();
+
+is(
+ Entity(q{}),
+ "<a test="'&'"/>",
+ 'Entity escaping'
+);
+
+is(
+ Entity(" . . . .\t. \n"),
+ " . . . . .
\n",
+ 'Entity formatting'
+);
+
+is(
+ EncodeURI("/test.plp?f00=~_a&b!\n "),
+ '/test.plp?f00%3d~_a%26b!%0a%20',
+ 'EncodeURI'
+);
+
+is(
+ DecodeURI('?f0%30+%20b%61r!'),
+ '?f00 bar!',
+ 'DecodeURI'
+);
+
+is(
+ DecodeURI('%0A%0a%a %000 %fg%%fF'."\377"),
+ "\n\n%a \0000 %fg%\377\377",
+ 'DecodeURI 2'
+);