summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-24 07:35:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-24 07:35:38 +0000
commit4e58f21f798861453b08c281fae2ec3a57396ba5 (patch)
treeef2f5c13c66348678aade546cbaad359e2391355 /file.c
parenta34343b3a3659101ad1d1704b2c004d26f7c93b4 (diff)
Add tests for `File.extname`
* file.c (rb_file_s_extname): [DOC] add an example. * test/ruby/test_path.rb (test_extname): add tests. [Fix GH-978] * path starts with dot ('.a.rb') * path includes dir name ('a/b/d/test.rb') * path includes dir name and dir name starts with dot ('.a/b/d/test.rb') git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/file.c b/file.c
index 1adbe76802..48c978ed36 100644
--- a/file.c
+++ b/file.c
@@ -4237,6 +4237,7 @@ ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
*
* File.extname("test.rb") #=> ".rb"
* File.extname("a/b/d/test.rb") #=> ".rb"
+ * File.extname(".a/b/d/test.rb") #=> ".rb"
* File.extname("foo.") #=> ""
* File.extname("test") #=> ""
* File.extname(".profile") #=> ""