Skip to content

Commit

Permalink
Add test for conformance error.
Browse files Browse the repository at this point in the history
  • Loading branch information
RZhang05 committed Sep 26, 2024
1 parent 6d60b9d commit 6298e1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/tests/checker/stringer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ func TestCheckInvalidStringer(t *testing.T) {
let a: {Stringer} = <-create R()
let b: {Stringer} = [<-create R()]
let c: {Stringer} = {1: true}
struct Foo: Stringer {}
`)

errs := RequireCheckerErrors(t, err, 3)
errs := RequireCheckerErrors(t, err, 4)

assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
assert.IsType(t, &sema.TypeMismatchError{}, errs[1])
assert.IsType(t, &sema.TypeMismatchError{}, errs[2])
assert.IsType(t, &sema.ConformanceError{}, errs[3])
}

0 comments on commit 6298e1f

Please sign in to comment.