OSSP CVS Repository

ossp - Difference in ossp-pkg/path/path_test.pl versions 1.1 and 1.2
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/path/path_test.pl 1.1 -> 1.2

--- path_test.pl 2002/01/21 13:32:35     1.1
+++ path_test.pl 2002/08/27 19:04:33     1.2
@@ -1,52 +1,63 @@
 
 @abs2rel = (
-        'a/b/c          /               a/b/c',
-        'a/b/c          /a              a/b/c',
-        '/a/b/c         a               ERROR',
+    'a/b/c          /               a/b/c',
+    'a/b/c          /a              a/b/c',
+    '/a/b/c         a               ERROR',
 );
 
 @rel2abs = (
-        '/a/b/c         /               /a/b/c',
-        '/a/b/c         /a              /a/b/c',
-        'a/b/c          a               ERROR',
-        '..             /a              /',
-        '../            /a              /',
-        '../..          /a              /',
-        '../../         /a              /',
-        '../../..       /a              /',
-        '../../../      /a              /',
-        '../b           /a              /b',
-        '../b/          /a              /b/',
-        '../../b        /a              /b',
-        '../../b/       /a              /b/',
-        '../../../b     /a              /b',
-        '../../../b/    /a              /b/',
-        '../b/c         /a              /b/c',
-        '../b/c/        /a              /b/c/',
-        '../../b/c      /a              /b/c',
-        '../../b/c/     /a              /b/c/',
-        '../../../b/c   /a              /b/c',
-        '../../../b/c/  /a              /b/c/',
+    '/a/b/c         /               /a/b/c',
+    '/a/b/c         /a              /a/b/c',
+    'a/b/c          a               ERROR',
+    '..             /a              /',
+    '../            /a              /',
+    '../..          /a              /',
+    '../../         /a              /',
+    '../../..       /a              /',
+    '../../../      /a              /',
+    '../b           /a              /b',
+    '../b/          /a              /b/',
+    '../../b        /a              /b',
+    '../../b/       /a              /b/',
+    '../../../b     /a              /b',
+    '../../../b/    /a              /b/',
+    '../b/c         /a              /b/c',
+    '../b/c/        /a              /b/c/',
+    '../../b/c      /a              /b/c',
+    '../../b/c/     /a              /b/c/',
+    '../../../b/c   /a              /b/c',
+    '../../../b/c/  /a              /b/c/',
 );
 
 @common = (
-        '/a/b/c         /a/b/c          .',
-        '/a/b/c         /a/b/           c',
-        '/a/b/c         /a/b            c',
-        '/a/b/c         /a/             b/c',
-        '/a/b/c         /a              b/c',
-        '/a/b/c         /               a/b/c',
-        '/a/b/c         /a/b/c          .',
-        '/a/b/c         /a/b/c/         .',
-        '/a/b/c/        /a/b/c          ./',
-        '/a/b/          /a/b/c          ../',
-        '/a/b           /a/b/c          ..',
-        '/a/            /a/b/c          ../../',
-        '/a             /a/b/c          ../..',
-        '/              /a/b/c          ../../../',
-        '/a/b/c         /a/b/z          ../c',
-        '/a/b/c         /a/y/z          ../../b/c',
-        '/a/b/c         /x/y/z          ../../../a/b/c',
+    '/a/b/c         /a/b/c          .',
+    '/a/b/c         /a/b/           c',
+    '/a/b/c         /a/b            c',
+    '/a/b/c         /a/             b/c',
+    '/a/b/c         /a              b/c',
+    '/a/b/c         /               a/b/c',
+    '/a/b/c         /a/b/c          .',
+    '/a/b/c         /a/b/c/         .',
+    '/a/b/c/        /a/b/c          ./',
+    '/a/b/          /a/b/c          ../',
+    '/a/b           /a/b/c          ..',
+    '/a/            /a/b/c          ../../',
+    '/a             /a/b/c          ../..',
+    '/              /a/b/c          ../../../',
+    '/a/b/c         /a/b/z          ../c',
+    '/a/b/c         /a/y/z          ../../b/c',
+    '/a/b/c         /x/y/z          ../../../a/b/c',
+);
+
+@canon = (
+    'a              a',
+    'a/             a',
+    'a/b            a/b',
+    'a////b         a/b',
+    '.              .',
+    'a/..           .',
+    'a/../../..     ../..',
+    '/a/../../../b  /b',
 );
 
 $cnt = 0;
@@ -90,11 +101,21 @@
     if ($d[0] eq $result) {
         print STDERR "OK: rel2abs: $d[0] $d[1] -> $result\n";
     } else {
-        print 'X';
         print STDERR "ERROR: rel2abs: $d[0] $d[1] -> $result (It should be '$d[2]')\n";
         $cnt++;
     }
 }
+
+foreach (@canon) {
+    @d = split;
+    chop($result = `./$progname canon $d[0]`);
+    if ($d[1] eq $result) {
+        print STDERR "OK: canon: $d[0] -> $result\n";
+    } else {
+        print STDERR "ERROR: canon: $d[0] -> $result (It should be '$d[1]')\n";
+        $cnt++;
+    }
+}
 
 close(LOG);
 

CVSTrac 2.0.1