summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_eval.rb4
-rw-r--r--bootstraptest/test_proc.rb17
-rw-r--r--bootstraptest/test_syntax.rb11
-rw-r--r--bootstraptest/test_thread.rb34
4 files changed, 66 insertions, 0 deletions
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index 7fdfda8272..8b99c7968c 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -282,3 +282,7 @@ assert_equal 'ok', %q{
:ok
end
}, '[ruby-core:16796]'
+
+assert_normal_exit %q{
+ eval("", method(:proc).call {}.binding)
+}
diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb
index ab309fe534..51c69448c8 100644
--- a/bootstraptest/test_proc.rb
+++ b/bootstraptest/test_proc.rb
@@ -259,3 +259,20 @@ assert_equal %Q{ok\n}, %q{
GC.start
block.call
}, '[ruby-core:14885]'
+
+assert_equal 'ok', %q{
+ a = lambda {|x, y, &b| b }
+ b = a.curry[1]
+ if b.call(2){} == nil
+ :ng
+ else
+ :ok
+ end
+}, '[ruby-core:15551]'
+
+assert_equal 'ok', %q{
+ lambda {
+ break :ok
+ :ng
+ }.call
+}, '[ruby-dev:34646]'
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index 5479de0573..a9005a4292 100644
--- a/bootstraptest/test_syntax.rb
+++ b/bootstraptest/test_syntax.rb
@@ -817,3 +817,14 @@ assert_equal 'ok', %q{
end
}, '[ruby-core:14537]'
+assert_equal 'ok', %q{
+ a = [false]
+ (a[0] &&= true) == false ? :ok : :ng
+}, '[ruby-dev:34679]'
+
+assert_normal_exit %q{
+ a = []
+ 100.times {|i| a << i << nil << nil }
+ p a.compact!
+}
+
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 3b1fa3f2a8..66b53634ac 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -1,3 +1,5 @@
+# Thread and Fiber
+
assert_equal %q{ok}, %q{
Thread.new{
}.join
@@ -268,3 +270,35 @@ assert_normal_exit %q{
at_exit { Fiber.new{}.resume }
}
+assert_normal_exit %q{
+ g = enum_for(:local_variables)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = enum_for(:block_given?)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = enum_for(:binding)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = "abc".enum_for(:scan, /./)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ g = Module.enum_for(:new)
+ loop { g.next }
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ Fiber.new(&Object.method(:class_eval)).resume("foo")
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
+ Thread.new("foo", &Object.method(:class_eval)).join
+}, '[ruby-dev:34128]'