Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 169 lines (151 sloc) 2.198 kb
a13b22a @vincentisambart splitted test_roxor.rb in multiple files
vincentisambart authored
1 assert '42', "FOO=42; p FOO"
2 assert '42', "FOO=42; p Object::FOO"
3 assert '42', "class X; FOO=42; end; p X::FOO"
4 assert '42', "class X; end; X::FOO=42; p X::FOO"
5
6 assert ':ok', %q{
7 class X; FOO=123; end
8 begin
9 p FOO
10 rescue NameError
11 p :ok
12 end
13 }
14
15 assert '42', "class X; FOO=42; def foo; FOO; end; end; p X.new.foo"
16 assert '42', %q{
17 FOO=123
18 class X; FOO=42; end
19 class Y < X; def foo; FOO; end; end
20 p Y.new.foo
21 }
22
23 assert '42', "FOO=42; 1.times { p FOO }"
24 assert '42', %q{
25 module X
26 FOO=42
27 1.times { p FOO }
28 end
29 }
30
31 assert '42', %q{
32 class X
33 FOO = 42
34 class Y; def foo; FOO; end; end
35 end
36 p X::Y.new.foo
37 }
38
39 assert '42', %q{
40 class X; FOO = 42; end
41 class Y < X; def foo; FOO; end; end
42 p Y.new.foo
43 }
44
45 assert '42', %q{
46 class X; FOO = 123; end
47 class Z
48 FOO = 42
49 class Y < X; def foo; FOO; end; end
50 end
51 p Z::Y.new.foo
52 }
53
54 assert '42', %q{
55 class A
56 module B
57 def foo
58 42
59 end
60 end
61 module C
62 extend B
63 end
64 end
65 p A::C.foo
66 }
67
68 assert 'true', 'p ::String == String'
69
70 assert '42', %q{
71 o = Object.new
72 class << o
73 module Foo
74 Bar = 42
75 end
76 class Baz; include Foo; end
77 class Baz;
78 def self.bar; Bar; end
79 end
80 def baz; Baz; end
81 end
82 p o.baz.bar
6b101bd @takaokouji supported lexical const lookup. (fixes #619, #626, #1167, #1192) (ref…
takaokouji authored
83 }
a13b22a @vincentisambart splitted test_roxor.rb in multiple files
vincentisambart authored
84
85 assert '42', %q{
86 module M
87 FOO = 42
88 class X
89 class << self; p FOO; end
90 end
91 end
92 }
b379b2f adding a failing test
Laurent Sansonetti authored
93
94 assert '1', "class Float; class X; p ROUNDS; end; end"
f8ba7b5 @vincentisambart added a new failing test based of bug report #305
vincentisambart authored
95
da13a29 @takaokouji fixed test for constant because current MacRuby behavior is same like…
takaokouji authored
96 assert ':ok', %{
f8ba7b5 @vincentisambart added a new failing test based of bug report #305
vincentisambart authored
97 class A
98 B = 42
99 end
100 A.class_eval {
101 def bar
102 p B
103 end
104 }
da13a29 @takaokouji fixed test for constant because current MacRuby behavior is same like…
takaokouji authored
105 begin
106 A.new.bar
107 rescue NameError
108 p :ok
109 end
110 }
19b6a62 adding 2 failing tests
Laurent Sansonetti authored
111
112 assert ':ok', %{
113 module M
114 FOO=42
115 end
116 class M::Foo
117 begin
118 p FOO
119 rescue NameError
120 p :ok
121 end
122 end
123 }
7ee6023 adding failing test
Laurent Sansonetti authored
124
125 assert '42', %{
126 class Foo
127 FOO=42
128 def hey
129 Object.new.instance_eval { p FOO }
130 end
131 end
132 Foo.new.hey
6b101bd @takaokouji supported lexical const lookup. (fixes #619, #626, #1167, #1192) (ref…
takaokouji authored
133 }
7f6a154 added one failing test
Laurent Sansonetti authored
134
135 assert '42', %{
136 module Foo; end
137 module Foo::Bar
138 FOO=42
139 class X
140 p FOO
141 end
142 end
143 }
4d032ff added one failing test
Laurent Sansonetti authored
144
145 assert '42', %{
146 module M
147 FOO=42
148 class C; end
149 class C::C2
150 p FOO
151 end
152 end
153 }
9af54a3 add reduction for bug #1045
Laurent Sansonetti authored
154
155 assert '42', %{
156 module M
157 FOO=42
158 end
159 class M::C; end
160 module M
161 class C
162 def initialize
163 p FOO
164 end
165 end
166 end
167 M::C.new
168 }
Something went wrong with that request. Please try again.