(t *testing.T)
| 214 | } |
| 215 | |
| 216 | func TestRelTypeExprFromDecl(t *testing.T) { |
| 217 | relTypeExpr, err := RelTypeExprFromDecl(ast.Decl{ |
| 218 | ast.NewAtom("foo", ast.Variable{"X"}, ast.Variable{"Y"}), |
| 219 | nil, |
| 220 | []ast.BoundDecl{ |
| 221 | ast.NewBoundDecl(ast.StringBound, ast.NumberBound), |
| 222 | ast.NewBoundDecl(ast.NumberBound, ast.StringBound), |
| 223 | }, |
| 224 | nil, |
| 225 | }) |
| 226 | if err != nil { |
| 227 | t.Fatal(err) |
| 228 | } |
| 229 | want := NewUnionType( |
| 230 | NewRelType(ast.StringBound, ast.NumberBound), |
| 231 | NewRelType(ast.NumberBound, ast.StringBound)) |
| 232 | if !relTypeExpr.Equals(want) { |
| 233 | t.Errorf("%v.Equals(%v)=false want true", relTypeExpr, want) |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | func TestRelTypeMethods(t *testing.T) { |
| 238 | tests := []struct { |
nothing calls this directly
no test coverage detected