@@ -154,6 +154,7 @@ def test_inspect
154154 end
155155
156156 def test_recursive_inspect
157+ # TODO: TruffleRuby's Data fails this test with a StackOverflowError
157158 klass = Data . define ( :value , :head , :tail ) do
158159 def initialize ( value :, head : nil , tail : nil )
159160 case tail
@@ -174,32 +175,32 @@ def initialize(value:, head: nil, tail: nil)
174175 end
175176 end
176177
177- pend_if_jruby do
178- # anonymous class
179- list = klass [ value : 1 , tail : [ 2 , 3 , 4 ] ]
180- seen = "#<data #{ klass . inspect } :...>"
181- assert_equal (
182- " #<data value=1 , head=nil ," \
183- " tail=#<data value=2 , head=#{ seen } ," \
184- " tail=#<data value=3 , head=#{ seen } ," \
185- " tail=#<data value=4, head= #{ seen } ," \
186- " tail=nil>>>>" ,
187- list . inspect
188- )
189-
190- # named class
191- Object . const_set ( :DoubleLinkList , klass )
192- list = DoubleLinkList [ value : 1 , tail : [ 2 , 3 , 4 ] ]
193- seen = "#<data DoubleLinkList:...>"
194- assert_equal (
195- "#<data DoubleLinkList value=1, head=nil," \
196- " tail=#<data DoubleLinkList value=2, head=#{ seen } ," \
197- " tail=#<data DoubleLinkList value=3, head=#{ seen } ," \
198- " tail=#<data DoubleLinkList value=4, head=#{ seen } ," \
199- " tail=nil>>>>" ,
200- list . inspect
201- )
202- end
178+ # anonymous class
179+ list = klass [ value : 1 , tail : [ 2 , 3 , 4 ] ]
180+ seen = "#<data #{ klass . inspect } :...>"
181+ assert_equal (
182+ "#<data value=1, head=nil," \
183+ " tail= #<data value=2 , head=#{ seen } ," \
184+ " tail=#<data value=3 , head=#{ seen } ," \
185+ " tail=#<data value=4 , head=#{ seen } ," \
186+ " tail=nil>>>>" ,
187+ # TODO: JRuby's Data fails on the next line
188+ list . inspect
189+ )
190+
191+ # named class
192+ Object . const_set ( :DoubleLinkList , klass )
193+ list = DoubleLinkList [ value : 1 , tail : [ 2 , 3 , 4 ] ]
194+ seen = "#<data DoubleLinkList:...>"
195+ assert_equal (
196+ "#<data DoubleLinkList value=1, head=nil," \
197+ " tail=#<data DoubleLinkList value=2, head=#{ seen } ," \
198+ " tail=#<data DoubleLinkList value=3, head=#{ seen } ," \
199+ " tail=#<data DoubleLinkList value=4, head=#{ seen } ," \
200+ " tail=nil>>>>" ,
201+ # TODO: JRuby's Data fails on the next line
202+ list . inspect
203+ )
203204 ensure
204205 Object . instance_eval { remove_const ( :DoubleLinkList ) } rescue nil
205206 end
@@ -350,6 +351,7 @@ class Inherited < Abstract.define(:foo)
350351 end
351352
352353 def test_subclass_can_create
354+ # TODO: JRuby's Data fails all of these
353355 assert_equal 1 , Inherited [ 1 ] . foo
354356 assert_equal 2 , Inherited [ foo : 2 ] . foo
355357 assert_equal 3 , Inherited . new ( 3 ) . foo
@@ -364,9 +366,8 @@ class InheritsClassMethod < AbstractWithClassMethod.define(:foo)
364366 end
365367
366368 def test_subclass_class_method
367- pend_if_jruby do
368- assert_equal :ok , InheritsClassMethod . inherited_class_method
369- end
369+ # TODO: JRuby's Data fails on the next line
370+ assert_equal :ok , InheritsClassMethod . inherited_class_method
370371 end
371372
372373 class AbstractWithOverride < Data
@@ -377,10 +378,10 @@ class InheritsOverride < AbstractWithOverride.define(:foo)
377378 end
378379
379380 def test_subclass_override_deconstruct
381+ # TODO: JRuby's Data fails on the next line
380382 data = InheritsOverride [ :foo ]
381- pend_if_truffleruby do
382- assert_equal %i[ ok foo ] , data . deconstruct
383- end
383+ # TODO: TruffleRuby's Data fails on the next line
384+ assert_equal %i[ ok foo ] , data . deconstruct
384385 end
385386
386387 end
0 commit comments