Skip to content

Commit a33a9d5

Browse files
committed
add function args trailing comma test
Signed-off-by: jaredzhou <zhouzhenyu1313@163.com>
1 parent a12ba1d commit a33a9d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/parser/cedar_unmarshal_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,11 @@ func TestParseTrailingCommas(t *testing.T) {
518518
`permit (principal, action, resource) when {User::"alice" in [User::"bob",] };`,
519519
ast.Permit().When(ast.EntityUID(types.Ident("User"), types.String("alice")).In(ast.Set(ast.EntityUID(types.Ident("User"), types.String("bob"))))),
520520
},
521+
{
522+
"extension call with trailing comma",
523+
`permit (principal, action, resource) when { ip("1.2.3.4",) };`,
524+
ast.Permit().When(ast.ExtensionCall("ip", ast.String("1.2.3.4"))),
525+
},
521526
}
522527

523528
for _, tt := range parseTests {

0 commit comments

Comments
 (0)