diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-09-06 09:06:21 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-09-06 14:20:13 +0000 |
commit | 5537169ef0a8a42f8923a545a1fa6a1768e0f0d6 (patch) | |
tree | cc906b4c34c53ce7468effe6ab5ec7aa41410570 /test | |
parent | dae6a0a29579291f7775e397c1523ce23fba1f48 (diff) |
[ruby/yarp] Temporarily add name_constant to replace name on ClassNode/ModuleNode
https://github.com/ruby/yarp/commit/8f87686e9c
Diffstat (limited to 'test')
28 files changed, 155 insertions, 79 deletions
diff --git a/test/yarp/errors_test.rb b/test/yarp/errors_test.rb index 90be76ab5b..f5064ba70f 100644 --- a/test/yarp/errors_test.rb +++ b/test/yarp/errors_test.rb @@ -19,10 +19,11 @@ module YARP Location(), ConstantReadNode(:Parent), StatementsNode( - [ModuleNode([], Location(), MissingNode(), nil, Location(), "")] + [ModuleNode([], Location(), MissingNode(), nil, Location(), "", :"")] ), Location(), - "Parent" + "Parent", + :Parent ) assert_errors expected, "module Parent module end", [ @@ -393,7 +394,7 @@ module YARP Location(), nil, nil, - StatementsNode([ModuleNode([], Location(), ConstantReadNode(:A), nil, Location(), "A")]), + StatementsNode([ModuleNode([], Location(), ConstantReadNode(:A), nil, Location(), "A", :A)]), [], Location(), nil, @@ -424,7 +425,7 @@ module YARP BlockNode( [], nil, - StatementsNode([ModuleNode([], Location(), ConstantReadNode(:Foo), nil, Location(), "Foo")]), + StatementsNode([ModuleNode([], Location(), ConstantReadNode(:Foo), nil, Location(), "Foo", :Foo)]), Location(), Location() ), @@ -464,7 +465,8 @@ module YARP nil, nil, Location(), - "A" + "A", + :A )] ), [], @@ -979,7 +981,8 @@ module YARP nil, StatementsNode([ReturnNode(Location(), nil)]), Location(), - "A" + "A", + :A ) assert_errors expected, "class A; return; end", [ @@ -994,7 +997,8 @@ module YARP ConstantReadNode(:A), StatementsNode([ReturnNode(Location(), nil)]), Location(), - "A" + "A", + :A ) assert_errors expected, "module A; return; end", [ diff --git a/test/yarp/snapshots/classes.txt b/test/yarp/snapshots/classes.txt index 4f4bc5513d..9a5fd84ad2 100644 --- a/test/yarp/snapshots/classes.txt +++ b/test/yarp/snapshots/classes.txt @@ -17,7 +17,8 @@ ProgramNode(0...370)( )] ), (14...17), - "A" + "A", + :A ), ClassNode(19...39)( [], @@ -34,7 +35,8 @@ ProgramNode(0...370)( (36...39) ), (36...39), - "A" + "A", + :A ), ClassNode(41...75)( [], @@ -51,7 +53,8 @@ ProgramNode(0...370)( (72...75) ), (72...75), - "A" + "A", + :A ), ClassNode(77...98)( [:a], @@ -69,7 +72,8 @@ ProgramNode(0...370)( )] ), (95...98), - "A" + "A", + :A ), SingletonClassNode(100...120)( [], @@ -123,7 +127,8 @@ ProgramNode(0...370)( )] ), (159...162), - "A" + "A", + :A ), ClassNode(164...218)( [], @@ -149,7 +154,8 @@ ProgramNode(0...370)( )] ), (215...218), - "A" + "A", + :A ), SingletonClassNode(220...240)( [], @@ -281,7 +287,8 @@ ProgramNode(0...370)( ), nil, (367...370), - "A" + "A", + :A )] ) ) diff --git a/test/yarp/snapshots/method_calls.txt b/test/yarp/snapshots/method_calls.txt index 6f11633de2..a479948ce1 100644 --- a/test/yarp/snapshots/method_calls.txt +++ b/test/yarp/snapshots/method_calls.txt @@ -1192,7 +1192,8 @@ ProgramNode(0...1237)( )] ), (926...929), - "Bar" + "Bar", + :Bar )] ), nil, @@ -1224,7 +1225,8 @@ ProgramNode(0...1237)( )] ), (957...960), - "Bar" + "Bar", + :Bar )] ), nil, diff --git a/test/yarp/snapshots/modules.txt b/test/yarp/snapshots/modules.txt index 9ed5c89fe1..4b00c1ebaf 100644 --- a/test/yarp/snapshots/modules.txt +++ b/test/yarp/snapshots/modules.txt @@ -15,7 +15,8 @@ ProgramNode(0...140)( )] ), (15...18), - "A" + "A", + :A ), InterpolatedStringNode(20...38)( (20...23), @@ -50,7 +51,8 @@ ProgramNode(0...140)( ), nil, (52...55), - "M" + "M", + :M ), ModuleNode(57...85)( [:x], @@ -73,7 +75,8 @@ ProgramNode(0...140)( (82...85) ), (82...85), - "A" + "A", + :A ), ModuleNode(87...101)( [], @@ -85,7 +88,8 @@ ProgramNode(0...140)( ), nil, (98...101), - "A" + "A", + :A ), ModuleNode(103...120)( [], @@ -107,7 +111,8 @@ ProgramNode(0...140)( ), nil, (117...120), - "B" + "B", + :B ), ModuleNode(122...140)( [], @@ -129,7 +134,8 @@ ProgramNode(0...140)( ), nil, (137...140), - "B" + "B", + :B )] ) ) diff --git a/test/yarp/snapshots/seattlerb/TestRubyParserShared.txt b/test/yarp/snapshots/seattlerb/TestRubyParserShared.txt index 32b444a2fc..27e8a6b753 100644 --- a/test/yarp/snapshots/seattlerb/TestRubyParserShared.txt +++ b/test/yarp/snapshots/seattlerb/TestRubyParserShared.txt @@ -87,7 +87,8 @@ ProgramNode(0...689)( )] ), (266...269), - "X" + "X", + :X ), ClassNode(293...376)( [], @@ -111,11 +112,13 @@ ProgramNode(0...689)( )] ), (355...358), - "Y" + "Y", + :Y )] ), (373...376), - "X" + "X", + :X ), ClassNode(395...498)( [], @@ -162,7 +165,8 @@ ProgramNode(0...689)( )] ), (495...498), - "X" + "X", + :X ), ModuleNode(517...565)( [], @@ -182,7 +186,8 @@ ProgramNode(0...689)( )] ), (562...565), - "X" + "X", + :X ), ModuleNode(568...651)( [], @@ -202,11 +207,13 @@ ProgramNode(0...689)( )] ), (630...633), - "Y" + "Y", + :Y )] ), (648...651), - "X" + "X", + :X ), CallNode(670...689)( nil, diff --git a/test/yarp/snapshots/seattlerb/class_comments.txt b/test/yarp/snapshots/seattlerb/class_comments.txt index c7a36379fb..1751e29929 100644 --- a/test/yarp/snapshots/seattlerb/class_comments.txt +++ b/test/yarp/snapshots/seattlerb/class_comments.txt @@ -23,7 +23,8 @@ ProgramNode(19...71)( )] ), (68...71), - "X" + "X", + :X )] ) ) diff --git a/test/yarp/snapshots/seattlerb/defn_oneliner_eq2.txt b/test/yarp/snapshots/seattlerb/defn_oneliner_eq2.txt index db684a0b10..43d13f27cb 100644 --- a/test/yarp/snapshots/seattlerb/defn_oneliner_eq2.txt +++ b/test/yarp/snapshots/seattlerb/defn_oneliner_eq2.txt @@ -31,7 +31,8 @@ ProgramNode(0...28)( )] ), (25...28), - "X" + "X", + :X )] ) ) diff --git a/test/yarp/snapshots/seattlerb/defs_oneliner_eq2.txt b/test/yarp/snapshots/seattlerb/defs_oneliner_eq2.txt index 793139ed5e..636a1fd66c 100644 --- a/test/yarp/snapshots/seattlerb/defs_oneliner_eq2.txt +++ b/test/yarp/snapshots/seattlerb/defs_oneliner_eq2.txt @@ -31,7 +31,8 @@ ProgramNode(0...33)( )] ), (30...33), - "X" + "X", + :X )] ) ) diff --git a/test/yarp/snapshots/seattlerb/magic_encoding_comment.txt b/test/yarp/snapshots/seattlerb/magic_encoding_comment.txt index b183b39ead..c231c84124 100644 --- a/test/yarp/snapshots/seattlerb/magic_encoding_comment.txt +++ b/test/yarp/snapshots/seattlerb/magic_encoding_comment.txt @@ -31,7 +31,8 @@ ProgramNode(18...90)( )] ), (87...90), - "ExampleUTF8ClassNameVarietà" + "ExampleUTF8ClassNameVarietà", + :ExampleUTF8ClassNameVarietà )] ) ) diff --git a/test/yarp/snapshots/seattlerb/module_comments.txt b/test/yarp/snapshots/seattlerb/module_comments.txt index b384dad8e5..63019796cc 100644 --- a/test/yarp/snapshots/seattlerb/module_comments.txt +++ b/test/yarp/snapshots/seattlerb/module_comments.txt @@ -21,7 +21,8 @@ ProgramNode(24...77)( )] ), (74...77), - "X" + "X", + :X )] ) ) diff --git a/test/yarp/snapshots/seattlerb/parse_line_heredoc_hardnewline.txt b/test/yarp/snapshots/seattlerb/parse_line_heredoc_hardnewline.txt index 5f4c3ec93d..c29b09012e 100644 --- a/test/yarp/snapshots/seattlerb/parse_line_heredoc_hardnewline.txt +++ b/test/yarp/snapshots/seattlerb/parse_line_heredoc_hardnewline.txt @@ -19,7 +19,8 @@ ProgramNode(0...48)( nil, nil, (45...48), - "Foo" + "Foo", + :Foo )] ) ) diff --git a/test/yarp/snapshots/unparser/corpus/literal/class.txt b/test/yarp/snapshots/unparser/corpus/literal/class.txt index b4cca16f39..60de85cb90 100644 --- a/test/yarp/snapshots/unparser/corpus/literal/class.txt +++ b/test/yarp/snapshots/unparser/corpus/literal/class.txt @@ -9,7 +9,8 @@ ProgramNode(0...213)( nil, nil, (8...11), - "A" + "A", + :A ), SingletonClassNode(13...27)( [], @@ -41,7 +42,8 @@ ProgramNode(0...213)( nil, nil, (60...63), - "B" + "B", + :B ), ClassNode(65...82)( [], @@ -59,7 +61,8 @@ ProgramNode(0...213)( nil, nil, (79...82), - "C" + "C", + :C ), ClassNode(84...99)( [], @@ -69,7 +72,8 @@ ProgramNode(0...213)( ConstantReadNode(94...95)(:B), nil, (96...99), - "A" + "A", + :A ), ClassNode(101...119)( [], @@ -83,7 +87,8 @@ ProgramNode(0...213)( ), nil, (116...119), - "A" + "A", + :A ), ClassNode(121...142)( [], @@ -101,7 +106,8 @@ ProgramNode(0...213)( ), nil, (139...142), - "B" + "B", + :B ), ClassNode(144...198)( [], @@ -150,7 +156,8 @@ ProgramNode(0...213)( )] ), (195...198), - "A" + "A", + :A ), ClassNode(200...213)( [], @@ -164,7 +171,8 @@ ProgramNode(0...213)( nil, nil, (210...213), - "A" + "A", + :A )] ) ) diff --git a/test/yarp/snapshots/unparser/corpus/literal/if.txt b/test/yarp/snapshots/unparser/corpus/literal/if.txt index b25ada8a36..0ab7b31163 100644 --- a/test/yarp/snapshots/unparser/corpus/literal/if.txt +++ b/test/yarp/snapshots/unparser/corpus/literal/if.txt @@ -81,7 +81,8 @@ ProgramNode(0...246)( )] ), (130...133), - "A" + "A", + :A ), ModuleNode(135...170)( [:foo], @@ -115,7 +116,8 @@ ProgramNode(0...246)( )] ), (167...170), - "B" + "B", + :B ), UnlessNode(171...197)( (171...177), diff --git a/test/yarp/snapshots/unparser/corpus/literal/module.txt b/test/yarp/snapshots/unparser/corpus/literal/module.txt index 8ec85333e2..d2dd0fa351 100644 --- a/test/yarp/snapshots/unparser/corpus/literal/module.txt +++ b/test/yarp/snapshots/unparser/corpus/literal/module.txt @@ -7,7 +7,8 @@ ProgramNode(0...106)( ConstantReadNode(7...8)(:A), nil, (9...12), - "A" + "A", + :A ), ModuleNode(14...29)( [], @@ -19,7 +20,8 @@ ProgramNode(0...106)( ), nil, (26...29), - "B" + "B", + :B ), ModuleNode(31...49)( [], @@ -35,7 +37,8 @@ ProgramNode(0...106)( ), nil, (46...49), - "C" + "C", + :C ), ModuleNode(51...106)( [], @@ -82,7 +85,8 @@ ProgramNode(0...106)( )] ), (103...106), - "A" + "A", + :A )] ) ) diff --git a/test/yarp/snapshots/unparser/corpus/literal/send.txt b/test/yarp/snapshots/unparser/corpus/literal/send.txt index 68eb442889..ff90dc52cd 100644 --- a/test/yarp/snapshots/unparser/corpus/literal/send.txt +++ b/test/yarp/snapshots/unparser/corpus/literal/send.txt @@ -38,7 +38,8 @@ ProgramNode(0...999)( )] ), (32...35), - "A" + "A", + :A ), ModuleNode(37...73)( [:local], @@ -65,7 +66,8 @@ ProgramNode(0...999)( )] ), (70...73), - "A" + "A", + :A ), CallNode(74...89)( ClassNode(74...85)( @@ -76,7 +78,8 @@ ProgramNode(0...999)( nil, nil, (82...85), - "A" + "A", + :A ), (85...86), (86...89), @@ -94,7 +97,8 @@ ProgramNode(0...999)( ConstantReadNode(97...98)(:A), nil, (99...102), - "A" + "A", + :A ), (102...103), (103...106), diff --git a/test/yarp/snapshots/unparser/corpus/literal/while.txt b/test/yarp/snapshots/unparser/corpus/literal/while.txt index 6bddfff409..aed21abefc 100644 --- a/test/yarp/snapshots/unparser/corpus/literal/while.txt +++ b/test/yarp/snapshots/unparser/corpus/literal/while.txt @@ -64,7 +64,8 @@ ProgramNode(0...620)( )] ), (65...68), - "A" + "A", + :A ), DefNode(70...110)( (74...77), @@ -159,7 +160,8 @@ ProgramNode(0...620)( )] ), (143...146), - "A" + "A", + :A ), ModuleNode(148...182)( [:foo], @@ -193,7 +195,8 @@ ProgramNode(0...620)( )] ), (179...182), - "A" + "A", + :A ), ModuleNode(184...228)( [:foo], @@ -237,7 +240,8 @@ ProgramNode(0...620)( )] ), (225...228), - "A" + "A", + :A ), ModuleNode(230...299)( [], @@ -312,7 +316,8 @@ ProgramNode(0...620)( )] ), (296...299), - "A" + "A", + :A ), ModuleNode(301...370)( [], @@ -377,7 +382,8 @@ ProgramNode(0...620)( )] ), (367...370), - "A" + "A", + :A ), LocalVariableWriteNode(371...402)( :x, diff --git a/test/yarp/snapshots/unparser/corpus/semantic/while.txt b/test/yarp/snapshots/unparser/corpus/semantic/while.txt index de7f2b750d..7426fac71d 100644 --- a/test/yarp/snapshots/unparser/corpus/semantic/while.txt +++ b/test/yarp/snapshots/unparser/corpus/semantic/while.txt @@ -186,7 +186,8 @@ ProgramNode(0...188)( )] ), (185...188), - "A" + "A", + :A )] ) ) diff --git a/test/yarp/snapshots/while.txt b/test/yarp/snapshots/while.txt index e85b5e6672..c04963bf9b 100644 --- a/test/yarp/snapshots/while.txt +++ b/test/yarp/snapshots/while.txt @@ -139,7 +139,8 @@ ProgramNode(0...314)( )] ), (195...198), - "Foo" + "Foo", + :Foo ), StatementsNode(200...205)([BreakNode(200...205)(nil, (200...205))]), 0 diff --git a/test/yarp/snapshots/whitequark/class.txt b/test/yarp/snapshots/whitequark/class.txt index 217b8011f0..ad181664b5 100644 --- a/test/yarp/snapshots/whitequark/class.txt +++ b/test/yarp/snapshots/whitequark/class.txt @@ -9,7 +9,8 @@ ProgramNode(0...29)( nil, nil, (10...13), - "Foo" + "Foo", + :Foo ), ClassNode(15...29)( [], @@ -19,7 +20,8 @@ ProgramNode(0...29)( nil, nil, (26...29), - "Foo" + "Foo", + :Foo )] ) ) diff --git a/test/yarp/snapshots/whitequark/class_definition_in_while_cond.txt b/test/yarp/snapshots/whitequark/class_definition_in_while_cond.txt index d14e3907f0..292b0b7988 100644 --- a/test/yarp/snapshots/whitequark/class_definition_in_while_cond.txt +++ b/test/yarp/snapshots/whitequark/class_definition_in_while_cond.txt @@ -88,7 +88,8 @@ ProgramNode(0...197)( )] ), (136...139), - "Foo" + "Foo", + :Foo ), StatementsNode(141...146)([BreakNode(141...146)(nil, (141...146))]), 0 @@ -116,7 +117,8 @@ ProgramNode(0...197)( )] ), (182...185), - "Foo" + "Foo", + :Foo ), StatementsNode(187...192)([BreakNode(187...192)(nil, (187...192))]), 0 diff --git a/test/yarp/snapshots/whitequark/class_super.txt b/test/yarp/snapshots/whitequark/class_super.txt index 4a77a4213c..6ebbb1364c 100644 --- a/test/yarp/snapshots/whitequark/class_super.txt +++ b/test/yarp/snapshots/whitequark/class_super.txt @@ -9,7 +9,8 @@ ProgramNode(0...20)( ConstantReadNode(12...15)(:Bar), nil, (17...20), - "Foo" + "Foo", + :Foo )] ) ) diff --git a/test/yarp/snapshots/whitequark/class_super_label.txt b/test/yarp/snapshots/whitequark/class_super_label.txt index 10d4b28cea..a53dac8f2c 100644 --- a/test/yarp/snapshots/whitequark/class_super_label.txt +++ b/test/yarp/snapshots/whitequark/class_super_label.txt @@ -21,7 +21,8 @@ ProgramNode(0...20)( ), nil, (17...20), - "Foo" + "Foo", + :Foo )] ) ) diff --git a/test/yarp/snapshots/whitequark/cpath.txt b/test/yarp/snapshots/whitequark/cpath.txt index 1c3d4e6c30..3df789b5ca 100644 --- a/test/yarp/snapshots/whitequark/cpath.txt +++ b/test/yarp/snapshots/whitequark/cpath.txt @@ -7,7 +7,8 @@ ProgramNode(0...39)( ConstantPathNode(7...12)(nil, ConstantReadNode(9...12)(:Foo), (7...9)), nil, (14...17), - "Foo" + "Foo", + :Foo ), ModuleNode(19...39)( [], @@ -19,7 +20,8 @@ ProgramNode(0...39)( ), nil, (36...39), - "Foo" + "Foo", + :Foo )] ) ) diff --git a/test/yarp/snapshots/whitequark/if_while_after_class__since_32.txt b/test/yarp/snapshots/whitequark/if_while_after_class__since_32.txt index e1e4419b1c..a088237a85 100644 --- a/test/yarp/snapshots/whitequark/if_while_after_class__since_32.txt +++ b/test/yarp/snapshots/whitequark/if_while_after_class__since_32.txt @@ -19,7 +19,8 @@ ProgramNode(0...178)( nil, nil, (35...38), - "Kernel" + "Kernel", + :Kernel ), ClassNode(40...87)( [], @@ -44,7 +45,8 @@ ProgramNode(0...178)( nil, nil, (84...87), - "Kernel" + "Kernel", + :Kernel ), ModuleNode(89...128)( [], @@ -62,7 +64,8 @@ ProgramNode(0...178)( ), nil, (125...128), - "Kernel" + "Kernel", + :Kernel ), ModuleNode(130...178)( [], @@ -87,7 +90,8 @@ ProgramNode(0...178)( ), nil, (175...178), - "Kernel" + "Kernel", + :Kernel )] ) ) diff --git a/test/yarp/snapshots/whitequark/module.txt b/test/yarp/snapshots/whitequark/module.txt index 395bc61366..9d3a1148f3 100644 --- a/test/yarp/snapshots/whitequark/module.txt +++ b/test/yarp/snapshots/whitequark/module.txt @@ -7,7 +7,8 @@ ProgramNode(0...15)( ConstantReadNode(7...10)(:Foo), nil, (12...15), - "Foo" + "Foo", + :Foo )] ) ) diff --git a/test/yarp/snapshots/whitequark/numparam_outside_block.txt b/test/yarp/snapshots/whitequark/numparam_outside_block.txt index c3972dbf9b..9ef6b0cfbb 100644 --- a/test/yarp/snapshots/whitequark/numparam_outside_block.txt +++ b/test/yarp/snapshots/whitequark/numparam_outside_block.txt @@ -22,7 +22,8 @@ ProgramNode(0...83)( [CallNode(36...38)(nil, nil, (36...38), nil, nil, nil, nil, 2, "_1")] ), (40...43), - "A" + "A", + :A ), DefNode(45...64)( (54...55), @@ -47,7 +48,8 @@ ProgramNode(0...83)( [CallNode(76...78)(nil, nil, (76...78), nil, nil, nil, nil, 2, "_1")] ), (80...83), - "A" + "A", + :A )] ) ) diff --git a/test/yarp/snapshots/whitequark/parser_bug_490.txt b/test/yarp/snapshots/whitequark/parser_bug_490.txt index ca6ab1a69d..680b5fe146 100644 --- a/test/yarp/snapshots/whitequark/parser_bug_490.txt +++ b/test/yarp/snapshots/whitequark/parser_bug_490.txt @@ -49,7 +49,8 @@ ProgramNode(0...132)( nil, nil, (72...75), - "C" + "C", + :C )] ), (77...80) @@ -80,7 +81,8 @@ ProgramNode(0...132)( ConstantReadNode(116...117)(:M), nil, (119...122), - "M" + "M", + :M )] ), (124...127) diff --git a/test/yarp/snapshots/whitequark/parser_bug_518.txt b/test/yarp/snapshots/whitequark/parser_bug_518.txt index dd831ac54d..0f92f9e95b 100644 --- a/test/yarp/snapshots/whitequark/parser_bug_518.txt +++ b/test/yarp/snapshots/whitequark/parser_bug_518.txt @@ -9,7 +9,8 @@ ProgramNode(0...15)( ConstantReadNode(10...11)(:B), nil, (12...15), - "A" + "A", + :A )] ) ) |