|
|
@ -69,6 +69,27 @@ class TestGlob < Test::Unit::TestCase |
|
|
|
puts("Testing: #{test}") |
|
|
|
assert_equal(result, unit.match?(test)) |
|
|
|
end |
|
|
|
unit = Glob.new("**/*.php") |
|
|
|
[ |
|
|
|
"archive.php", true, |
|
|
|
"assets/thing.js", false, |
|
|
|
"assetsthing.js", false, |
|
|
|
"parts/thing.php", true, |
|
|
|
"partsthing.php", true, |
|
|
|
".php", true, |
|
|
|
"parts/extra/test.php", true, |
|
|
|
"archive.php", true, |
|
|
|
"assets/thing.js", false, |
|
|
|
"assetsthing.js", false, |
|
|
|
"parts/thing.php", true, |
|
|
|
"partsthing.php", true, |
|
|
|
".php", true, |
|
|
|
"parts/extra/test.php", true, |
|
|
|
"parts/extra/test.php/literally/anything/here", true |
|
|
|
].each_slice(2) do |test, result| |
|
|
|
puts("Testing: #{test}") |
|
|
|
assert_equal(result, unit.match?(test)) |
|
|
|
end |
|
|
|
puts "Test group: char ranges" |
|
|
|
unit = Glob.new("/test/[9-z]+") |
|
|
|
[ |
|
|
|