From 76c7586da8ba4192d4df32d1b4f2cfa4bfafbdfd Mon Sep 17 00:00:00 2001 From: Daniel Sainati Date: Tue, 24 Oct 2023 13:08:06 -0400 Subject: [PATCH] add test --- runtime/tests/checker/entitlements_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/runtime/tests/checker/entitlements_test.go b/runtime/tests/checker/entitlements_test.go index e0e980a0a7..2b6ea3360a 100644 --- a/runtime/tests/checker/entitlements_test.go +++ b/runtime/tests/checker/entitlements_test.go @@ -1524,6 +1524,21 @@ func TestCheckBasicEntitlementMappingAccess(t *testing.T) { require.IsType(t, &sema.InvalidEntitlementMappingTypeError{}, errs[0]) }) + t.Run("mapping without keyword", func(t *testing.T) { + t.Parallel() + + _, err := ParseAndCheck(t, ` + entitlement mapping N {} + resource interface R { + access(N) let foo: String + } + `) + + errs := RequireCheckerErrors(t, err, 1) + + require.IsType(t, &sema.MappingAccessMissingKeywordError{}, errs[0]) + }) + t.Run("multiple mappings disjunction with regular", func(t *testing.T) { t.Parallel()