New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Util.t in branches/UKMO/r6232_tracer_advection/NEMOGCM/EXTERNAL/fcm/t/Fcm – NEMO

source: branches/UKMO/r6232_tracer_advection/NEMOGCM/EXTERNAL/fcm/t/Fcm/Util.t @ 9295

Last change on this file since 9295 was 9295, checked in by jcastill, 6 years ago

Remove svn keywords

File size: 1.3 KB
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More qw{no_plan};
7
8main();
9
10sub main {
11    use_ok('Fcm::Util');
12    test_tidy_url();
13}
14
15################################################################################
16# Tests tidy_url
17sub test_tidy_url {
18    my $prefix = "tidy_url";
19    my %RESULT_OF = (
20        ''                         => '',
21        'foo'                      => 'foo',
22        'foo/bar'                  => 'foo/bar',
23        'http://foo/bar'           => 'http://foo/bar',
24        'http://foo/bar@1234'      => 'http://foo/bar@1234',
25        'http://foo/bar/@1234'     => 'http://foo/bar@1234',
26        'http://foo/bar/.'         => 'http://foo/bar',
27        'http://foo/bar/.@1234'    => 'http://foo/bar@1234',
28        'http://foo/bar/./@1234'   => 'http://foo/bar@1234',
29        'http://foo/bar/./baz'     => 'http://foo/bar/baz',
30        'http://foo/bar/..'        => 'http://foo',
31        'http://foo/bar/..@1234'   => 'http://foo@1234',
32        'http://foo/bar/../@1234'  => 'http://foo@1234',
33        'http://foo/bar/../baz'    => 'http://foo/baz',
34        'http://foo/bar/../.'      => 'http://foo',
35        'http://foo/bar/baz/../..' => 'http://foo',
36    );
37    for my $key (sort keys(%RESULT_OF)) {
38        is(tidy_url($key), $RESULT_OF{$key}, "$prefix: $key");
39    }
40}
41
42# TODO: more unit tests
43
44__END__
Note: See TracBrowser for help on using the repository browser.