ruby-changes:59220
From: Nobuyoshi <ko1@a...>
Date: Thu, 12 Dec 2019 20:57:24 +0900 (JST)
Subject: [ruby-changes:59220] dd60856f8d (master): [cygwin] fix File.absolute_path? test
https://git.ruby-lang.org/ruby.git/commit/?id=dd60856f8d From dd60856f8ddaa0652bf019589f05705e00279b8c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 12 Dec 2019 20:53:59 +0900 Subject: [cygwin] fix File.absolute_path? test Paths start with the root are absolute on cygwin, regardless the drive letter. diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index 02f7464..96e2ca2 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -501,13 +501,16 @@ class TestFile < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file.rb#L501 assert_file.not_absolute_path?("~") assert_file.not_absolute_path?("~user") - if /mswin|mingw/ =~ RUBY_PLATFORM + if /cygwin|mswin|mingw/ =~ RUBY_PLATFORM assert_file.absolute_path?("C:\\foo\\bar") assert_file.absolute_path?("C:/foo/bar") - assert_file.not_absolute_path?("/foo/bar\\baz") else assert_file.not_absolute_path?("C:\\foo\\bar") assert_file.not_absolute_path?("C:/foo/bar") + end + if /mswin|mingw/ =~ RUBY_PLATFORM + assert_file.not_absolute_path?("/foo/bar\\baz") + else assert_file.absolute_path?("/foo/bar\\baz") end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/