summaryrefslogtreecommitdiff
path: root/t/lib/glob-case.t
diff options
context:
space:
mode:
authorPaul Moore <Paul.Moore@uk.origin-it.com>1999-11-02 11:11:25 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-02 04:17:43 +0000
commit220398a0501cffd114fa4441a4a685dc486ed3d8 (patch)
treeafb7531e11c154e2149b77a89f86a6e2c76768f1 /t/lib/glob-case.t
parent4348140855c01942a6531a8decdfe1325fe36f8a (diff)
downloadperl-220398a0501cffd114fa4441a4a685dc486ed3d8.tar.gz
various File::Glob fixes for DOSISH platforms
Message-Id: <714DFA46B9BBD0119CD000805FC1F53BDC38E3@UKRUX002.rundc.uk.origin-it.com> Subject: File::Glob again. Final patch, honest! p4raw-id: //depot/perl@4615
Diffstat (limited to 't/lib/glob-case.t')
-rwxr-xr-xt/lib/glob-case.t48
1 files changed, 48 insertions, 0 deletions
diff --git a/t/lib/glob-case.t b/t/lib/glob-case.t
new file mode 100755
index 0000000000..2e65a0fc8b
--- /dev/null
+++ b/t/lib/glob-case.t
@@ -0,0 +1,48 @@
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ print "1..7\n";
+}
+END {
+ print "not ok 1\n" unless $loaded;
+}
+use File::Glob qw(:glob csh_glob);
+$loaded = 1;
+print "ok 1\n";
+
+# Test the actual use of the case sensitivity tags, via csh_glob()
+import File::Glob ':nocase';
+@a = csh_glob("lib/G*.t"); # At least glob-basic.t glob-case.t glob-global.t
+print "not " unless @a >= 3;
+print "ok 2\n";
+
+# This may fail on systems which are not case-PRESERVING
+import File::Glob ':case';
+@a = csh_glob("lib/G*.t"); # None should be uppercase
+print "not " unless @a == 0;
+print "ok 3\n";
+
+# Test the explicit use of the GLOB_NOCASE flag
+@a = File::Glob::glob("lib/G*.t", GLOB_NOCASE);
+print "not " unless @a >= 3;
+print "ok 4\n";
+
+# Test Win32 backslash nastiness...
+if ($^O ne 'MSWin32') {
+ print "ok 5\nok 6\nok 7\n";
+}
+else {
+ @a = File::Glob::glob("lib\\g*.t");
+ print "not " unless @a >= 3;
+ print "ok 5\n";
+ mkdir "[]", 0;
+ @a = File::Glob::glob("\\[\\]", GLOB_QUOTE);
+ rmdir "[]";
+ print "# returned @a\nnot " unless @a == 1;
+ print "ok 6\n";
+ @a = File::Glob::glob("lib\\*", GLOB_QUOTE);
+ print "not " if @a == 0;
+ print "ok 7\n";
+}