(t *testing.T)
| 46 | } |
| 47 | |
| 48 | func TestBoundsCheckingPositive(t *testing.T) { |
| 49 | tests := []struct { |
| 50 | name string |
| 51 | boundDecl ast.BoundDecl |
| 52 | }{ |
| 53 | { |
| 54 | name: "simple arguments", |
| 55 | boundDecl: ast.NewBoundDecl(ast.NameBound, ast.NumberBound), |
| 56 | }, |
| 57 | { |
| 58 | name: "proper type expressions", |
| 59 | boundDecl: ast.NewBoundDecl( |
| 60 | ast.ApplyFn{symbols.ListType, []ast.BaseTerm{ast.NumberBound}}, |
| 61 | ast.ApplyFn{symbols.PairType, []ast.BaseTerm{ast.NumberBound, ast.StringBound}}), |
| 62 | }, |
| 63 | { |
| 64 | name: "union type expressions", |
| 65 | boundDecl: ast.NewBoundDecl( |
| 66 | ast.ApplyFn{symbols.UnionType, []ast.BaseTerm{ast.NameBound, ast.NumberBound}}, |
| 67 | ast.ApplyFn{symbols.UnionType, []ast.BaseTerm{ast.NumberBound, ast.StringBound}}), |
| 68 | }, |
| 69 | } |
| 70 | for _, test := range tests { |
| 71 | t.Run(test.name, func(t *testing.T) { |
| 72 | if errs := checkBoundDecl(test.boundDecl); errs != nil { |
| 73 | t.Error(errs[0]) |
| 74 | } |
| 75 | }) |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func TestCheckDeclExternal(t *testing.T) { |
| 80 | testCases := []struct { |
nothing calls this directly
no test coverage detected