[libcatmandu-perl] 81/101: fix tests on windows

Jonas Smedegaard dr at jones.dk
Tue Feb 23 13:43:58 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcatmandu-perl.

commit a237bc1cf2008202f48ece70780b2645ce93f951
Author: Nicolas Steenlant <nicolas.steenlant at ugent.be>
Date:   Tue Feb 9 14:17:52 2016 +0100

    fix tests on windows
---
 t/Catmandu-Util.t | 15 ++++++++++-----
 t/Catmandu.t      |  4 ++--
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/t/Catmandu-Util.t b/t/Catmandu-Util.t
index 6e91ffb..525a962 100644
--- a/t/Catmandu-Util.t
+++ b/t/Catmandu-Util.t
@@ -5,6 +5,7 @@ use warnings;
 use Test::More;
 use Test::Exception;
 use IO::Handle;
+use File::Spec;
 
 use utf8;
 use feature 'state';
@@ -247,11 +248,15 @@ EOF
     is_deeply Catmandu::Util::read_json("t/small.json") , { "hello" => "ვეპხის ტყაოსანი შოთა რუსთაველი"} , 'read_json';
 }
 
-is Catmandu::Util::join_path("/this/..","./is","..","./a/../weird/path","./../../isnt/../it") , "/it" , 'join_path';
-is Catmandu::Util::normalize_path("/this/../is/../a/../weird/path/../../isnt/../it") , "/it" , 'normalize_path';
-is Catmandu::Util::segmented_path("12345678",segment_size =>2,base_path=>"/x") , "/x/12/34/56/78" , 'segmented_path';
+is Catmandu::Util::join_path("/this/..", "./is","..", "./a/../weird/path", "./../../isnt/../it"),
+    File::Spec->join_path("/it"), 'join_path';
+is Catmandu::Util::normalize_path("/this/../is/../a/../weird/path/../../isnt/../it"),
+    File::Spec->join_path("/it"), 'normalize_path';
+is Catmandu::Util::segmented_path("12345678", segment_size => 2, base_path => "/x"),
+    File::Spec->join_path("/x/12/34/56/78"), 'segmented_path';
 
-is_deeply [Catmandu::Util::parse_data_path("foo.bar.x")] , [ ['foo','bar'], "x" ] , "parse_data_path";
+is_deeply [Catmandu::Util::parse_data_path("foo.bar.x")],
+    [ ['foo','bar'], "x" ] , "parse_data_path";
 
 is Catmandu::Util::get_data({ foo => 'bar'} , 'foo') , 'bar' , 'get_data(foo)';
 ok ! Catmandu::Util::get_data({ foo => 'bar'} , 'foo2') , 'get_data(foo2)';
@@ -497,4 +502,4 @@ is Catmandu::Util::xml_declaration() , qq(<?xml version="1.0" encoding="UTF-8"?>
 
 is Catmandu::Util::xml_escape("<>'&") , '<>'&' , 'xml_escape';
 
-done_testing 572;
\ No newline at end of file
+done_testing 572;
diff --git a/t/Catmandu.t b/t/Catmandu.t
index d6d4a62..4919132 100644
--- a/t/Catmandu.t
+++ b/t/Catmandu.t
@@ -58,7 +58,7 @@ isa_ok(Catmandu->fixer,'Catmandu::Fix','fixer test');
 
 like(Catmandu->export_to_string({ foo => 'bar'}, 'JSON'),qr/{"foo":"bar"}/,'export_to_string');
 
-my $root = File::Spec->catfile(getcwd(),'t');
+my ($root_vol, $root) = File::Spec->splitpath(File::Spec->catfile(getcwd(),'t'));
 
 is(Catmandu->root, $root, 'root');
 is_deeply(Catmandu->roots,[$root],'roots');
@@ -70,4 +70,4 @@ my $exporter = Catmandu->exporter('Mock');
 Catmandu->export({ n => 1} , $exporter);
 is_deeply($exporter->as_arrayref,[{ n => 1}]);
 
-done_testing 28;
+done_testing;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-perl.git



More information about the Pkg-perl-cvs-commits mailing list