summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_path.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb
index fb58f65..24fc3a9 100644
--- a/test/ruby/test_path.rb
+++ b/test/ruby/test_path.rb
@@ -223,4 +223,13 @@ class TestPath < Test::Unit::TestCase
assert_equal('c', File.basename('///a/b/c'))
end
end
+
+ def test_extname
+ assert_equal('', File.extname('a'))
+ assert_equal('.rb', File.extname('a.rb'))
+ assert_equal('', File.extname('a.rb.'))
+ assert_equal('', File.extname('a.'))
+ assert_equal('', File.extname('.x'))
+ assert_equal('', File.extname('..x'))
+ end
end