aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-05-11 05:11:28 +1000
committerGravatar axel <axel@liljencrantz.se>2007-05-11 05:11:28 +1000
commite4f5bc69e29b88796b13eb117dde098695dad9b9 (patch)
tree260c37e0361e4d9a119f6cb478f1d4fe064706ee /fish_tests.c
parent03f322c7152c8f10805a0b8a75bf517e88fdf427 (diff)
Make sure that the PWD and HOME variables are always in canonical form
darcs-hash:20070510191128-ac50b-dd51a75617d62e4f403094ddc7527a82c5de3103.gz
Diffstat (limited to 'fish_tests.c')
-rw-r--r--fish_tests.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fish_tests.c b/fish_tests.c
index 31ea2b04..e7c18018 100644
--- a/fish_tests.c
+++ b/fish_tests.c
@@ -44,6 +44,8 @@
#include "output.h"
#include "exec.h"
#include "event.h"
+#include "path.h"
+#include "halloc.h"
#include "halloc_util.h"
/**
@@ -600,6 +602,26 @@ static void test_expand()
}
+static void test_path()
+{
+ say( L"Testing path functions" );
+
+ void *context = halloc( 0, 0 );
+
+
+ wchar_t *can = path_make_canonical( context, L"//foo//////bar/" );
+
+ if( wcscmp( can, L"/foo/bar" ) )
+ {
+ err( L"Bug in canonical PATH code" );
+ }
+
+ halloc_free( context );
+
+}
+
+
+
/**
Test speed of completion calculations
*/
@@ -673,6 +695,9 @@ void perf_complete()
}
+
+
+
/**
Main test
*/
@@ -697,6 +722,7 @@ int main( int argc, char **argv )
test_tok();
test_parser();
test_expand();
+ test_path();
say( L"Encountered %d errors in low-level tests", err_count );