()
| 1397 | } |
| 1398 | |
| 1399 | fn gen_column() -> impl Strategy<Value = (ReprColumnType, Datum<'static>, ResultSpec<'static>)> |
| 1400 | { |
| 1401 | let col_type = (select(SCALAR_TYPES), any::<bool>()) |
| 1402 | .prop_map(|(t, b)| t.nullable(b)) |
| 1403 | .prop_filter("need at least one value", |c| { |
| 1404 | SqlScalarType::from_repr(&c.scalar_type) |
| 1405 | .interesting_datums() |
| 1406 | .count() |
| 1407 | > 0 |
| 1408 | }); |
| 1409 | |
| 1410 | let result_spec = select(vec![ |
| 1411 | ResultSpec::nothing(), |
| 1412 | ResultSpec::null(), |
| 1413 | ResultSpec::anything(), |
| 1414 | ResultSpec::value_all(), |
| 1415 | ]); |
| 1416 | |
| 1417 | (col_type, result_spec).prop_flat_map(|(col, result_spec)| { |
| 1418 | gen_datums_for_type(&col).prop_map(move |datum| { |
| 1419 | let result_spec = result_spec.clone().union(ResultSpec::value(datum)); |
| 1420 | (col.clone(), datum, result_spec) |
| 1421 | }) |
| 1422 | }) |
| 1423 | } |
| 1424 | |
| 1425 | fn gen_expr_for_relation( |
| 1426 | relation: &ReprRelationType, |
no test coverage detected