Add test case with rest variable and no prefix elements

This commit is contained in:
Arthur Baars
2021-12-01 17:36:06 +01:00
parent f08eb8e616
commit 44a615839d
4 changed files with 5 additions and 4 deletions

View File

@@ -864,6 +864,7 @@ control/cases.rb:
# 67| getPattern: [ArrayPattern] [ ..., * ]
# 68| getBranch: [InClause] in ... then ...
# 68| getPattern: [ArrayPattern] [ ..., * ]
# 68| getRestVariableAccess: [LocalVariableAccess] x
# 68| getSuffixElement: [IntegerLiteral] 3
# 68| getSuffixElement: [IntegerLiteral] 4
# 69| getBranch: [InClause] in ... then ...

View File

@@ -156,8 +156,8 @@
| control/cases.rb:65:13:65:13 | 3 | 3 |
| control/cases.rb:66:7:66:7 | 1 | 1 |
| control/cases.rb:66:14:66:14 | 3 | 3 |
| control/cases.rb:68:10:68:10 | 3 | 3 |
| control/cases.rb:68:13:68:13 | 4 | 4 |
| control/cases.rb:68:11:68:11 | 3 | 3 |
| control/cases.rb:68:14:68:14 | 4 | 4 |
| control/cases.rb:69:10:69:10 | 3 | 3 |
| control/cases.rb:70:11:70:11 | 3 | 3 |
| control/cases.rb:71:7:71:7 | :a | a |

View File

@@ -67,7 +67,7 @@ caseAllBranches
| cases.rb:39:1:80:3 | case ... | 25 | cases.rb:65:3:65:18 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 26 | cases.rb:66:3:66:16 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 27 | cases.rb:67:3:67:9 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 28 | cases.rb:68:3:68:15 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 28 | cases.rb:68:3:68:16 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 29 | cases.rb:69:3:69:15 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 30 | cases.rb:70:3:70:17 | in ... then ... |
| cases.rb:39:1:80:3 | case ... | 31 | cases.rb:71:3:71:10 | in ... then ... |

View File

@@ -65,7 +65,7 @@ case expr
in [1, 2, 3, *]
in [1, *x, 3]
in [*]
in [*, 3, 4]
in [*x, 3, 4]
in [*, 3, *]
in [*a, 3, *b]
in {a:}