summaryrefslogtreecommitdiff
path: root/test/ruby/test_file_exhaustive.rb
AgeCommit message (Collapse)Author
2013-12-13test/ruby: better assertionsnobu
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26file.c: fix buffer overflownobu
* file.c (rb_readlink): fix buffer overflow on a long symlink. since rb_str_modify_expand() expands from its length but not its capacity, need to set the length properly for each expansion. [ruby-core:58592] [Bug #9157] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17file.c: fix memory leaknobu
* win32/file.c (rb_file_expand_path_internal): fix memory leaks at a non-absolute home exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-30skip if ENV['USER'] is nilnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-28add assert_not_empty ENV['USER']naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-25* file.c (rb_file_expand_path_internal): fix r42160; skip '~'.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-24file.c: exception message encodingnobu
* file.c (rb_file_expand_path_internal): preserve the file name encoding in an exception message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-13test_file_exhaustive.rb: fix abolute rootnobu
* test/ruby/test_file_exhaustive.rb (test_expand_path_home_dir_string): fix abolute root path for dosish platforms. [ruby-core:53354] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-11test_file_exhaustive.rb: others homenobu
* test/ruby/test_file_exhaustive.rb (test_expand_path_home_dir_string): add assertions for other user's home directory path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-10* test/ruby/test_file_exhaustive.rb (test_expand_path_home_dir_string):nobu
enable generic test on all platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-10Expand home directory when used in dir_stringluislavena
* win32/file.c (rb_file_expand_path_internal): Expand home directory when used as second parameter (dir_string). [ruby-core:53168] [Bug #8034] * test/ruby/test_file_exhaustive.rb: add test to verify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-17Skip path expansion for all wildcard charactersluislavena
* win32/file.c (replace_to_long_name): skip expansion for all wildcard characters. [ruby-core:49451] [Bug #7374] * test/ruby/test_file_exhaustive.rb: add more assertions to test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-16skip long name conversion if last character is a wildcard oneluislavena
* win32/file.c (replace_to_long_name): skip automatic path expansion when wildcard character is used. [ruby-core:49451] [Bug #7374] * test/ruby/test_file_exhaustive.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06Remove FIXME skip on Windows testluislavena
* test/ruby/test_file_exhaustive.rb: Remove FIXME skip on Windows specific test because the test in question was already fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16* test/ruby/envutil.rb (Test::Unit::Assertions#assert_file): rename from ↵kazu
file_assertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16file.c: ASCII-compatiblenobu
* file.c (rb_file_join): check nul-byte only for strings, since FilePathStringValue() does it. [ruby-core:48012] [Bug #7168] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16file.c: ASCII-compatiblenobu
* file.c (rb_file_join): path names must be ASCII-compatible. [ruby-core:48012] [Bug #7168] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-15envutil.rb: file_assertionnobu
* test/ruby/envutil.rb (Test::Unit::Assertions#file_assertion): rewrite file assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-09envutil.rb: assert_file and assert_file_notnobu
* test/ruby/envutil.rb (assert_file, assert_file_not): more descriptive assertions for File predicates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-29test/ruby/test_file_exhaustive.rb: fix test for HOME-less envsluislavena
* test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for posix environments where HOME is not defined. [ruby-core:47322] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-24Improve require/File.expand_path performance on Windowsluislavena
* configure.in (mingw): add shlwapi to the list of dependency libs for Windows. * win32/Makefile.sub (EXTSOLIBS): ditto. * internal.h: declare internal functions rb_w32_init_file, rb_file_expand_path_internal and rb_file_expand_path_fast. * file.c (Init_File): invoke Windows initialization rb_w32_init_file * win32/file.c (rb_file_load_path_internal): new function. Windows-specific implementation that replaces file_expand_path. [Bug #6836][ruby-core:46996] * win32/file.c (rb_w32_init_file): new function. Initialize codepage cache for faster conversion encodings lookup. * file.c (file_expand_path): rename to rb_file_expand_path_internal. Conditionally exclude from Windows. * file.c (rb_file_expand_path_fast): new function. delegates to rb_file_expand_path_internal without performing a hit to the filesystem. * file.c (file_expand_path_1): use rb_file_expand_path_internal without path expansion (used by require). * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * load.c (rb_get_expanded_load_path): use rb_file_expand_path_fast. * load.c (rb_feature_provided): ditto. * file.c (rb_file_expand_path): use rb_file_expand_path_internal with path expansion. * file.c (rb_file_absolute_path): ditto. * test/ruby/test_file_exhaustive.rb: new tests to exercise rb_file_expand_path_internal implementation and compliance with existing behaviors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-14* test/ruby/test_file_exhaustive.rbusa
(TestFileExhaustive#test_stat_dotted_prefix): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-14* test/ruby/test_file_exhaustive.rbusa
(TestFileExhaustive#test_stat_drive_root): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-09Optimize winnt_statshirosaki
* test/ruby/test_file_exhaustive.rb (TestFileExhaustive#test_stat_special_file): add a test. GetFileAttributesExW fails to get attributes of special files such as pagefile.sys. * win32/win32.c (check_valid_dir): for performance, check the path by FindFirstFileW only if the path containts "..." * win32/win32.c (winnt_stat): use GetFileAttributesExW instead of FindFirstFileW since GetFileAttributesExW is faster. Based on the patch by Dusan D. Majkic. [ruby-core:47083] [Feature #6845] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-07* test/ruby/test_file_exhaustive.rbusa
(TestFileExhaustive#test_expand_path*): refactoring. split the method into some chunks of the same kind of tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-25* file.c (rb_file_s_basename): ignore non-ascii extension innobu
different encoding, which cannot match. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-25* file.c (rb_enc_path_next, rb_enc_path_skip_prefix)nobu
(rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions. * file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [ruby-dev:45145] [Bug #5919] * dir.c (check_dirname, ruby_glob0): ditto. * ext/pathname/pathname.c (path_sub_ext): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-19* test/ruby/test_file_exhaustive.rb (test_expand_path): fix commit miss, ↵nobu
removed surplus downcase. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-19* test/ruby/test_file_exhaustive.rb (test_expand_path): ignore case of paths ↵nobu
on DOSISH platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-19* test/ruby/test_file_exhaustive.rb (test_expand_path): add tests for ↵nobu
absolute paths and drive letters. [ruby-core:42177] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-16 * test/ruby/test_file_exhaustive.rb (TestFileExhaustive::test_expand_path):shyouhei
ENV["HOME"] might not be set. On those cases without it an exception raises here, which effectively disables later tests on this method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-04* file.c (rb_file_s_readlink): symlink target should be innobu
filesystem encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-02* file.c (file_expand_path): wrong condition. [ruby-core:31591]usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29* file.c (file_expand_path): home directory must be absolute.nobu
[ruby-core:31537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29* file.c (file_expand_path): should check if could find user.nobu
[ruby-core:31538] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-04* file.c (rb_f_test): 'W' should test writable by real uid/git,nobu
not world writable. [ruby-core:30587] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-04* test/ruby/test_require.rb (test_relative_symlink): skip if symlink is notusa
implemented. * test/ruby/test_file_exhaustive.rb (test_stat, test_expand_path): ignore tests about nlink on Windows because its not imeplented because of performance problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-29* test/ruby: fixed nonsense assertions.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19* file.c (rb_file_s_extname): skip last directory separators.nobu
[ruby-core:29627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-12* file.c (rb_file_s_basename): check encoding of suffix.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25supress warnings.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-19* dir.c (GlobPathValue), file.c (rb_get_path_check): path namesnobu
must be ASCII compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-08* file.c (rb_file_s_basename): returns new string instead ofnobu
shared string from FilePathStringValue(). [ruby-core:24199] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-08* test/ruby/test_file_exhaustive.rb: add tests for File#size andmame
File.absolute_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18* test/ruby/test_file_exhaustive.rb: skip some tests if euid == 0.mame
a patch from Lucas Nussbaum in [ruby-core:22209]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18* file.c (rb_file_s_extname): fix for spaces before extention.nobu
[ruby-dev:38044] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12* win32/win32.c (open_dir_handle): extracted from rb_w32_opendir.nobu
* win32/win32.c (winnt_stat): gets rid of strange behavior of GetFileAttributes(). [ruby-core:21269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* test/ruby/test_file_exhaustive.rb (TestFileExhaustive#setup): set group of ↵kazu
tmpdir. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e