File: testURLFunctions

package info (click to toggle)
gnump3d 2.9.3-1sarge3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,420 kB
  • ctags: 366
  • sloc: perl: 10,649; sh: 188; makefile: 147
file content (21 lines) | stat: -rwxr-xr-x 413 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl
# Test the accuracy of URL encoding and decoding functions.

use gnump3d::url;

# Test string, containing 'special' characters.
my $text = 'This is a string%%$ ~#$$O##@$(%*&^())__+?>#^';

my $encoded = gnump3d::url::urlEncode( $text );

my $decoded = gnump3d::url::urlDecode( $encoded );

if ( $decoded eq $text )
{
    exit 0;
}
else
{
    print "Expected: $text\nGot: $decoded\n";
    exit 1;
}