Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Regression tests for JRUBY-2821 added.

git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@7215 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information...
commit cf21a56b2e3ef563d5314c1e1a776f021344cff6 1 parent db084a7
@vvs vvs authored
Showing with 18 additions and 2 deletions.
  1. +16 −0 test/test_command_line_switches.rb
  2. +2 −2 test/test_helper.rb
View
16 test/test_command_line_switches.rb
@@ -251,4 +251,20 @@ def test_client_vm_option
-e "print java.lang.management.ManagementFactory.getCompilationMXBean.name"})
assert_match /client/, result.downcase
end
+
+ # JRUBY-2821
+ def test_with_interesting_file_names
+ names = ["test-q", "test-d", "test--", "test-_", "test_U", "test_S_", "___D_",
+ "test__", "test_U_D", "_P_U_S_D"]
+ rgxes = [/test-q/, /test-d/, /test--/, /test-_/, /test_U/, /test_S_/, /___D_/,
+ /test__/, /test_U_D/, /_P_U_S_D/]
+
+ names.each_with_index do |name, idx|
+ with_jruby_shell_spawning do
+ with_temp_script('print __FILE__', name) do |s|
+ assert_match rgxes[idx], jruby("#{s.path}")
+ end
+ end
+ end
+ end
end
View
4 test/test_helper.rb
@@ -25,8 +25,8 @@ def jruby_with_pipe(pipe, *args)
JRuby.runtime.instance_config.run_ruby_in_process = prev_in_process
end
- def with_temp_script(script)
- Tempfile.open(["test-script", ".rb"]) do |f|
+ def with_temp_script(script, filename="test-script")
+ Tempfile.open([filename, ".rb"]) do |f|
begin
f << script
f.close
Please sign in to comment.
Something went wrong with that request. Please try again.