summaryrefslogtreecommitdiff
path: root/spec/ruby/core/file/shared/fnmatch.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/file/shared/fnmatch.rb')
-rw-r--r--spec/ruby/core/file/shared/fnmatch.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/file/shared/fnmatch.rb b/spec/ruby/core/file/shared/fnmatch.rb
index a8488fd30a..00682bb64c 100644
--- a/spec/ruby/core/file/shared/fnmatch.rb
+++ b/spec/ruby/core/file/shared/fnmatch.rb
@@ -75,6 +75,14 @@ describe :file_fnmatch, shared: true do
File.send(@method, 'c*t', 'c/a/b/t').should == true
end
+ it "does not match unterminated range of characters" do
+ File.send(@method, 'abc[de', 'abcd').should == false
+ end
+
+ it "does not match unterminated range of characters as a literal" do
+ File.send(@method, 'abc[de', 'abc[de').should == false
+ end
+
it "matches ranges of characters using bracket expression (e.g. [a-z])" do
File.send(@method, 'ca[a-z]', 'cat').should == true
end