summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-13 09:11:11 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-13 09:11:11 +0000
commit937092b8203c373c919a6f307f91e17d4bec5bb1 (patch)
tree07a130b71a37018a9ffaf3f970f42d4348db3a78 /sample
parent050f2d84603bd9b3761f1e498f81ce74719caeea (diff)
* range.c (range_step): step might be float 0 < x < 1.
* eval.c (rb_thread_schedule): pause if no runnable thread when there's only one thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 4b00990..4b62fb3 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1651,6 +1651,20 @@ test_ok(!x.foo)
test_ok(x.bar)
test_ok(!x.quux)
+test_check "path"
+test_ok(File.basename("a") == "a")
+test_ok(File.basename("a/b") == "b")
+test_ok(File.basename("a/b/") == "b")
+test_ok(File.basename("a/b////") == "b")
+test_ok(File.basename("a.rb", ".rb") == "a")
+test_ok(File.dirname("a") == ".")
+test_ok(File.dirname("/a") == "/")
+test_ok(File.dirname("a/b") == "a")
+test_ok(File.dirname("a/b/c") == "a/b")
+test_ok(File.dirname("/a/b/c") == "/a/b")
+test_ok(File.dirname("/a/b/") == "/a")
+test_ok(File.dirname("/a/b///") == "/a")
+
test_check "gc"
begin
1.upto(10000) {