FileTest.identical? is wrong
----------------------------
Key: JRUBY-4445
URL: http://jira.codehaus.org/browse/JRUBY-4445
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules, Intro, RubySpec
Affects Versions: JRuby 1.4
Reporter: Vladimir Sizikov
FileTest.identical? is currently implemented in such a way that it only
compares stat info of two files, so different files with same stats would be
considered equal, which is obviously wrong. This happens more often on Windows,
since stat info (dates) are with granularity 1 sec or so. So the two files
created quickly one after another would be considered the same!
This leads to rubyspec failures:
{noformat}
D:\work\jruby-dev\rubyspec.git>mspec -t j core\filetest\identical_spec.rb
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-01-10 c3a86fb) (Java
HotSpot(TM) Client VM 1.6.0_17) [x86-java]
...F
1)
FileTest.identical? returns true if both named files are identical FAILED
Expected true to be false
D:/work/jruby-dev/rubyspec.git/shared/file/identical.rb:41
D:/work/jruby-dev/rubyspec.git/core/filetest/identical_spec.rb:4
D:/work/jruby-dev/rubyspec.git/core/filetest/identical_spec.rb:55:in `load'
D:/work/jruby-dev/mspec.git/bin/mspec-run:8
{noformat}
MRI compares not only the sizes and stat info, but the file names as well
(after proper expanding).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email