summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-02-01 17:37:33 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2026-02-01 17:37:33 +0900
commit3b2ad4b741a103d34fc309591ba9573989bb7888 (patch)
tree8f2ff50df68f9cb266e00254ae045767da91acdd /test/ruby
parentd90f78b567ffa6cde84d26d8594c771bd1e4bd86 (diff)
Check the suffix argument always if given
It also must be ASCII-compatible and must not contain null byte, as well as the path argument.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_file_exhaustive.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 394dc47603..be9e6bd44e 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -1235,6 +1235,7 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal("foo", File.basename("foo", ".ext"))
assert_equal("foo", File.basename("foo.ext", ".ext"))
assert_equal("foo", File.basename("foo.ext", ".*"))
+ assert_raise(ArgumentError) {File.basename("", "\0")}
end
if NTFS