summaryrefslogtreecommitdiff
path: root/t/native.t
diff options
context:
space:
mode:
Diffstat (limited to 't/native.t')
-rw-r--r--t/native.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/native.t b/t/native.t
new file mode 100644
index 0000000..597808c
--- /dev/null
+++ b/t/native.t
@@ -0,0 +1,25 @@
+use strict;
+use warnings;
+use Test::More;
+
+use File::Spec ();
+use File::Spec::Native ();
+
+plan tests => 3;
+
+my @path = qw(dumb module);
+is(File::Spec->catfile(@path), File::Spec::Native->catfile(@path), 'base == Native');
+
+use File::Spec::Functions qw(catdir);
+is(catdir(@path), File::Spec::Native->catdir(@path), 'base == Native');
+
+# try to find something that isn't the current OS
+my $prefix = 'File::Spec';
+my $detected = $File::Spec::ISA[0];
+
+my $fsclass = "${prefix}::" . ($detected eq "${prefix}::Win32" ? 'Unix' : 'Win32');
+eval "require $fsclass" or die $@;
+
+my $foreign = $fsclass->catfile(@path);
+
+isnt($foreign, File::Spec::Native->catfile(@path), "foreign ($fsclass) != native ($detected)");