summaryrefslogtreecommitdiff
path: root/bootstraptest/test_knownbug.rb
blob: 99df9417375725155351361593570b7f5d73ad55 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# 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_normal_exit %q{
  Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| })
}

assert_not_match /method_missing/, %q{
  STDERR.reopen(STDOUT)
  variable_or_mehtod_not_exist
}

assert_normal_exit %q{
  ary = (1..10).to_a
  ary.permutation(2) {|x|
    if x == [1,2]
      ObjectSpace.each_object(String) {|s|
        s.clear if s.length == 40 || s.length == 80
      }
    end
  }
}, '[ruby-dev:31982]'

assert_normal_exit %q{
  ary = (1..100).to_a
  ary.permutation(2) {|x|
    if x == [1,2]
      ObjectSpace.each_object(Array) {|o| o.clear if o == ary && o.object_id != ary.object_id }
    end
  }
}, '[ruby-dev:31985]'

assert_normal_exit %q{
  Regexp.union("a", "a")
}

assert_equal 'ok', %q{
  begin
    Regexp.union(
      "a",
      Regexp.new("\x80".force_encoding("euc-jp")),
      Regexp.new("\x80".force_encoding("utf-8")))
    :ng
  rescue ArgumentError
    :ok
  end
}

assert_equal 'ok', %q{
  0**-1 == 0 ? :ng : :ok
}

assert_equal '(?-mix:\000)', %q{
  Regexp.new("\0")
}

assert_normal_exit %q{
  STDERR.reopen(STDOUT)
  require 'yaml'
  YAML.load("2000-01-01 00:00:00.#{"0"*1000} +00:00\n")
}, '[ruby-core:13735]'

assert_equal 'ok', %q{
  class C
    def each
      yield [1,2]
      yield 1,2
    end
  end
  vs1 = []
  C.new.each {|*v| vs1 << v }
  vs2 = []               
  C.new.to_enum.each {|*v| vs2 << v }
  vs1 == vs2 ? :ok : :ng
}, '[ruby-dev:32329]'