aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest/test_knownbug.rb
blob: f75a7145907fb214b230715eb1eb3c3d985b73d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# This test file concludes tests which point out known bugs.
# So all tests will cause failure.
#

assert_finish 1, %q{
  r, w = IO.pipe
  t1 = Thread.new { r.sysread(1) }
  t2 = Thread.new { r.sysread(1) }
  sleep 0.1
  w.write "a"
  sleep 0.1
  w.write "a"
}, '[ruby-dev:31866]'

assert_equal 'ok', %q{
  class Module
    def define_method2(name, &block)
      define_method(name, &block)
    end
  end
  class C
    define_method2(:m) {|x, y| :fail }
  end
  begin
    C.new.m([1,2])
  rescue ArgumentError
    :ok
  end
}

assert_normal_exit %q{
  Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| })
}

assert_normal_exit %q{
  eval("", TOPLEVEL_BINDING)
  minobj = ObjectSpace.to_enum(:each_object).min {|a,b| a.object_id <=> b.object_id }
  maxobj = ObjectSpace.to_enum(:each_object).max {|a,b| a.object_id <=> b.object_id }
  minobj.object_id.upto(maxobj.object_id) {|id|
    begin
      o = ObjectSpace._id2ref(id)
    rescue RangeError
      next
    end
    o.inspect
  }
}, '[ruby-dev:31911]'

assert_normal_exit %q{
  require 'continuation'
  Fiber.new{ callcc{|c| @c = c } }.resume
}, '[ruby-dev:31913]'