()
| 828 | |
| 829 | #[test] |
| 830 | fn test_between_nullability() { |
| 831 | let get_schema = |nullable| { |
| 832 | MockExprSchema::new() |
| 833 | .with_data_type(DataType::Int32) |
| 834 | .with_nullable(nullable) |
| 835 | }; |
| 836 | |
| 837 | let expr = col("foo").between(lit(1), lit(2)); |
| 838 | assert!(!expr.nullable(&get_schema(false)).unwrap()); |
| 839 | assert!(expr.nullable(&get_schema(true)).unwrap()); |
| 840 | |
| 841 | let null = lit(ScalarValue::Int32(None)); |
| 842 | |
| 843 | let expr = col("foo").between(null.clone(), lit(2)); |
| 844 | assert!(expr.nullable(&get_schema(false)).unwrap()); |
| 845 | |
| 846 | let expr = col("foo").between(lit(1), null.clone()); |
| 847 | assert!(expr.nullable(&get_schema(false)).unwrap()); |
| 848 | |
| 849 | let expr = col("foo").between(null.clone(), null); |
| 850 | assert!(expr.nullable(&get_schema(false)).unwrap()); |
| 851 | } |
| 852 | |
| 853 | fn assert_nullability(expr: &Expr, schema: &dyn ExprSchema, expected: bool) { |
| 854 | assert_eq!( |
nothing calls this directly
no test coverage detected
searching dependent graphs…