Skip to content

Commit

Permalink
[ruby/prism] Update tests and snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
paracycle authored and matzbot committed Dec 12, 2023
1 parent 43229d5 commit d313c82
Show file tree
Hide file tree
Showing 50 changed files with 106 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/prism/errors_test.rb
Expand Up @@ -367,7 +367,7 @@ def test_double_splat_followed_by_splat_argument
Location(),
Location(),
ArgumentsNode(1, [
KeywordHashNode([AssocSplatNode(expression("kwargs"), Location())]),
KeywordHashNode(0, [AssocSplatNode(expression("kwargs"), Location())]),
SplatNode(Location(), expression("args"))
]),
Location(),
Expand Down Expand Up @@ -414,13 +414,13 @@ def test_splat_argument_after_keyword_argument
Location(),
Location(),
ArgumentsNode(0, [
KeywordHashNode(
[AssocNode(
KeywordHashNode(1, [
AssocNode(
SymbolNode(0, nil, Location(), Location(), "foo"),
expression("bar"),
nil
)]
),
)
]),
SplatNode(Location(), expression("args"))
]),
Location(),
Expand Down
7 changes: 7 additions & 0 deletions test/prism/snapshots/arrays.txt
Expand Up @@ -79,6 +79,7 @@
│ ├── flags: ∅
│ ├── elements: (length: 1)
│ │ └── @ KeywordHashNode (location: (5,1)-(5,12))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (5,1)-(5,12))
│ │ ├── key:
Expand Down Expand Up @@ -175,6 +176,7 @@
│ ├── flags: ∅
│ ├── elements: (length: 1)
│ │ └── @ KeywordHashNode (location: (28,1)-(28,11))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (28,1)-(28,11))
│ │ ├── key:
Expand Down Expand Up @@ -632,6 +634,7 @@
│ ├── flags: ∅
│ ├── elements: (length: 1)
│ │ └── @ KeywordHashNode (location: (49,1)-(49,5))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocSplatNode (location: (49,1)-(49,5))
│ │ ├── value:
Expand All @@ -646,6 +649,7 @@
│ ├── flags: ∅
│ ├── elements: (length: 1)
│ │ └── @ KeywordHashNode (location: (51,1)-(51,5))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocSplatNode (location: (51,1)-(51,5))
│ │ ├── value:
Expand All @@ -668,6 +672,7 @@
│ │ ├── @ IntegerNode (location: (53,1)-(53,2))
│ │ │ └── flags: decimal
│ │ └── @ KeywordHashNode (location: (53,4)-(53,8))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocSplatNode (location: (53,4)-(53,8))
│ │ ├── value:
Expand All @@ -690,6 +695,7 @@
│ │ ├── @ IntegerNode (location: (55,1)-(55,2))
│ │ │ └── flags: decimal
│ │ └── @ KeywordHashNode (location: (55,4)-(55,20))
│ │ ├── flags: ∅
│ │ └── elements: (length: 3)
│ │ ├── @ AssocSplatNode (location: (55,4)-(55,8))
│ │ │ ├── value:
Expand Down Expand Up @@ -730,6 +736,7 @@
│ ├── flags: ∅
│ ├── elements: (length: 1)
│ │ └── @ KeywordHashNode (location: (58,2)-(58,12))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (58,2)-(58,12))
│ │ ├── key:
Expand Down
2 changes: 2 additions & 0 deletions test/prism/snapshots/constants.txt
Expand Up @@ -117,6 +117,7 @@
│ │ ├── flags: contains_keyword_splat
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (17,4)-(17,9))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocSplatNode (location: (17,4)-(17,9))
│ │ ├── value:
Expand Down Expand Up @@ -198,6 +199,7 @@
│ │ ├── flags: contains_keyword_splat
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (23,9)-(23,14))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocSplatNode (location: (23,9)-(23,14))
│ │ ├── value:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/if.txt
Expand Up @@ -250,6 +250,7 @@
│ │ │ ├── flags: ∅
│ │ │ └── arguments: (length: 1)
│ │ │ └── @ KeywordHashNode (location: (25,4)-(25,6))
│ │ │ ├── flags: static_keys
│ │ │ └── elements: (length: 1)
│ │ │ └── @ AssocNode (location: (25,4)-(25,6))
│ │ │ ├── key:
Expand Down
13 changes: 13 additions & 0 deletions test/prism/snapshots/method_calls.txt
Expand Up @@ -307,6 +307,7 @@
│ │ ├── flags: contains_keyword_splat
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (27,2)-(27,10))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocSplatNode (location: (27,2)-(27,10))
│ │ ├── value:
Expand Down Expand Up @@ -781,6 +782,7 @@
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "a"
│ │ └── @ KeywordHashNode (location: (60,8)-(60,32))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 2)
│ │ ├── @ AssocNode (location: (60,8)-(60,22))
│ │ │ ├── key:
Expand Down Expand Up @@ -912,6 +914,7 @@
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "a"
│ │ └── @ KeywordHashNode (location: (64,8)-(64,15))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (64,8)-(64,15))
│ │ ├── key:
Expand Down Expand Up @@ -980,6 +983,7 @@
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (66,3)-(66,17))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (66,3)-(66,17))
│ │ ├── key:
Expand Down Expand Up @@ -1011,6 +1015,7 @@
│ │ ├── flags: contains_keyword_splat
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (68,3)-(68,40))
│ │ ├── flags: ∅
│ │ └── elements: (length: 3)
│ │ ├── @ AssocNode (location: (68,3)-(68,20))
│ │ │ ├── key:
Expand Down Expand Up @@ -1065,6 +1070,7 @@
│ │ ├── flags: contains_keyword_splat
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (70,3)-(70,40))
│ │ ├── flags: ∅
│ │ └── elements: (length: 3)
│ │ ├── @ AssocNode (location: (70,3)-(70,20))
│ │ │ ├── key:
Expand Down Expand Up @@ -1167,6 +1173,7 @@
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (74,3)-(74,20))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (74,3)-(74,20))
│ │ ├── key:
Expand Down Expand Up @@ -1229,6 +1236,7 @@
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "a"
│ │ └── @ KeywordHashNode (location: (82,0)-(82,5))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (82,0)-(82,5))
│ │ ├── key:
Expand Down Expand Up @@ -1279,6 +1287,7 @@
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (87,4)-(87,21))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 2)
│ │ ├── @ AssocNode (location: (87,4)-(87,11))
│ │ │ ├── key:
Expand Down Expand Up @@ -1327,6 +1336,7 @@
│ │ ├── @ IntegerNode (location: (89,10)-(89,11))
│ │ │ └── flags: decimal
│ │ └── @ KeywordHashNode (location: (89,13)-(89,21))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (89,13)-(89,21))
│ │ ├── key:
Expand Down Expand Up @@ -1517,6 +1527,7 @@
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (103,4)-(103,11))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (103,4)-(103,11))
│ │ ├── key:
Expand Down Expand Up @@ -1544,6 +1555,7 @@
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (105,4)-(105,28))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (105,4)-(105,28))
│ │ ├── key:
Expand Down Expand Up @@ -1600,6 +1612,7 @@
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (107,4)-(107,24))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (107,4)-(107,24))
│ │ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/methods.txt
Expand Up @@ -1297,6 +1297,7 @@
│ │ │ ├── flags: contains_keyword_splat
│ │ │ └── arguments: (length: 1)
│ │ │ └── @ KeywordHashNode (location: (139,11)-(139,30))
│ │ │ ├── flags: ∅
│ │ │ └── elements: (length: 3)
│ │ │ ├── @ AssocSplatNode (location: (139,11)-(139,16))
│ │ │ │ ├── value:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/rescue.txt
Expand Up @@ -343,6 +343,7 @@
│ │ │ ├── flags: ∅
│ │ │ └── arguments: (length: 1)
│ │ │ └── @ KeywordHashNode (location: (29,4)-(29,6))
│ │ │ ├── flags: static_keys
│ │ │ └── elements: (length: 1)
│ │ │ └── @ AssocNode (location: (29,4)-(29,6))
│ │ │ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/aref_args_assocs.txt
Expand Up @@ -7,6 +7,7 @@
├── flags: ∅
├── elements: (length: 1)
│ └── @ KeywordHashNode (location: (1,1)-(1,7))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,1)-(1,7))
│ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/aref_args_lit_assocs.txt
Expand Up @@ -9,6 +9,7 @@
│ ├── @ IntegerNode (location: (1,1)-(1,2))
│ │ └── flags: decimal
│ └── @ KeywordHashNode (location: (1,4)-(1,10))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,4)-(1,10))
│ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/assoc_label.txt
Expand Up @@ -15,6 +15,7 @@
│ ├── flags: ∅
│ └── arguments: (length: 1)
│ └── @ KeywordHashNode (location: (1,2)-(1,5))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,2)-(1,5))
│ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/bug_249.txt
Expand Up @@ -66,6 +66,7 @@
│ │ ├── closing_loc: ∅
│ │ └── block: ∅
│ └── @ KeywordHashNode (location: (4,11)-(4,28))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (4,11)-(4,28))
│ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/bug_hash_args.txt
Expand Up @@ -21,6 +21,7 @@
│ │ ├── closing_loc: ∅
│ │ └── unescaped: "bar"
│ └── @ KeywordHashNode (location: (1,10)-(1,18))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,10)-(1,18))
│ ├── key:
Expand Down
Expand Up @@ -21,6 +21,7 @@
│ │ ├── closing_loc: ∅
│ │ └── unescaped: "bar"
│ └── @ KeywordHashNode (location: (1,10)-(1,18))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,10)-(1,18))
│ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/call_arg_assoc.txt
Expand Up @@ -17,6 +17,7 @@
│ ├── @ IntegerNode (location: (1,2)-(1,3))
│ │ └── flags: decimal
│ └── @ KeywordHashNode (location: (1,5)-(1,9))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,5)-(1,9))
│ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/call_arg_assoc_kwsplat.txt
Expand Up @@ -17,6 +17,7 @@
│ ├── @ IntegerNode (location: (1,2)-(1,3))
│ │ └── flags: decimal
│ └── @ KeywordHashNode (location: (1,5)-(1,15))
│ ├── flags: ∅
│ └── elements: (length: 2)
│ ├── @ AssocNode (location: (1,5)-(1,10))
│ │ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/call_arg_kwsplat.txt
Expand Up @@ -25,6 +25,7 @@
│ │ ├── closing_loc: ∅
│ │ └── block: ∅
│ └── @ KeywordHashNode (location: (1,5)-(1,8))
│ ├── flags: ∅
│ └── elements: (length: 1)
│ └── @ AssocSplatNode (location: (1,5)-(1,8))
│ ├── value:
Expand Down
3 changes: 3 additions & 0 deletions test/prism/snapshots/seattlerb/call_args_assoc_quoted.txt
Expand Up @@ -15,6 +15,7 @@
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (1,2)-(1,11))
│ │ ├── flags: ∅
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (1,2)-(1,11))
│ │ ├── key:
Expand Down Expand Up @@ -56,6 +57,7 @@
│ │ ├── flags: ∅
│ │ └── arguments: (length: 1)
│ │ └── @ KeywordHashNode (location: (3,2)-(3,8))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (3,2)-(3,8))
│ │ ├── key:
Expand Down Expand Up @@ -83,6 +85,7 @@
│ ├── flags: ∅
│ └── arguments: (length: 1)
│ └── @ KeywordHashNode (location: (5,2)-(5,8))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (5,2)-(5,8))
│ ├── key:
Expand Down
Expand Up @@ -17,6 +17,7 @@
│ ├── @ IntegerNode (location: (1,2)-(1,3))
│ │ └── flags: decimal
│ └── @ KeywordHashNode (location: (1,5)-(1,9))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,5)-(1,9))
│ ├── key:
Expand Down
Expand Up @@ -24,6 +24,7 @@
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "b"
│ │ └── @ KeywordHashNode (location: (1,7)-(1,14))
│ │ ├── flags: static_keys
│ │ └── elements: (length: 1)
│ │ └── @ AssocNode (location: (1,7)-(1,14))
│ │ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/call_assoc.txt
Expand Up @@ -15,6 +15,7 @@
│ ├── flags: ∅
│ └── arguments: (length: 1)
│ └── @ KeywordHashNode (location: (1,2)-(1,6))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,2)-(1,6))
│ ├── key:
Expand Down
1 change: 1 addition & 0 deletions test/prism/snapshots/seattlerb/call_assoc_new.txt
Expand Up @@ -15,6 +15,7 @@
│ ├── flags: ∅
│ └── arguments: (length: 1)
│ └── @ KeywordHashNode (location: (1,2)-(1,5))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,2)-(1,5))
│ ├── key:
Expand Down
Expand Up @@ -15,6 +15,7 @@
│ ├── flags: ∅
│ └── arguments: (length: 1)
│ └── @ KeywordHashNode (location: (1,2)-(5,3))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,2)-(5,3))
│ ├── key:
Expand Down
Expand Up @@ -15,6 +15,7 @@
│ ├── flags: ∅
│ └── arguments: (length: 1)
│ └── @ KeywordHashNode (location: (1,2)-(1,6))
│ ├── flags: static_keys
│ └── elements: (length: 1)
│ └── @ AssocNode (location: (1,2)-(1,6))
│ ├── key:
Expand Down

0 comments on commit d313c82

Please sign in to comment.