Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dsainati1 committed Oct 4, 2023
1 parent 1be5126 commit 16885b6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions runtime/tests/checker/entitlements_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7334,15 +7334,15 @@ func TestCheckEntitlementMissingInMap(t *testing.T) {
access(M) var foo: auth(M) &Int
init() {
self.foo = &3 as auth(X) &Int
var selfRef = &self as auth(X) &S;
selfRef.foo;
var selfRef = &self as auth(X) &S
selfRef.foo
}
}
`)

errors := RequireCheckerErrors(t, err, 2)
require.IsType(t, errors[0], &sema.NotDeclaredError{})
require.IsType(t, errors[1], &sema.InvalidNonEntitlementTypeInMapError{})
require.IsType(t, &sema.NotDeclaredError{}, errors[0])
require.IsType(t, &sema.InvalidNonEntitlementTypeInMapError{}, errors[1])
})

t.Run("non entitlement type", func(t *testing.T) {
Expand All @@ -7359,13 +7359,13 @@ func TestCheckEntitlementMissingInMap(t *testing.T) {
access(M) var foo: auth(M) &Int
init() {
self.foo = &3 as auth(X) &Int
var selfRef = &self as auth(X) &S;
selfRef.foo;
var selfRef = &self as auth(X) &S
selfRef.foo
}
}
`)

errors := RequireCheckerErrors(t, err, 1)
require.IsType(t, errors[0], &sema.InvalidNonEntitlementTypeInMapError{})
require.IsType(t, &sema.InvalidNonEntitlementTypeInMapError{}, errors[0])
})
}

0 comments on commit 16885b6

Please sign in to comment.