Skip to content

Commit

Permalink
test: strip tests
Browse files Browse the repository at this point in the history
Signed-off-by: Zhenchi <[email protected]>
  • Loading branch information
zhongzc committed Jan 2, 2024
1 parent 5d77864 commit d0da869
Showing 1 changed file with 0 additions and 88 deletions.
88 changes: 0 additions & 88 deletions src/mito2/src/sst/index/applier/builder/eq_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,92 +299,4 @@ mod tests {
builder.collect_or_eq_list(&eq_expr, &or_eq_list).unwrap();
assert!(builder.output.is_empty());
}

#[test]
fn test_collect_or_eq_list_type_mismatch() {
let metadata = test_region_metadata();
let mut builder =
SstIndexApplierBuilder::new("test".to_string(), test_object_store(), &metadata);

let eq_expr = DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(tag_column()),
op: Operator::Eq,
right: Box::new(string_lit("abc")),
});
let or_eq_list = DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(tag_column()),
op: Operator::Eq,
right: Box::new(int64_lit(1)), // mismatch type
})),
op: Operator::Or,
right: Box::new(DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(tag_column()),
op: Operator::Eq,
right: Box::new(string_lit("bar")),
})),
});

let res = builder.collect_or_eq_list(&eq_expr, &or_eq_list);
assert!(matches!(res, Err(Error::FieldTypeMismatch { .. })));
assert!(builder.output.is_empty());
}

#[test]
fn test_collect_or_eq_list_field_column() {
let metadata = test_region_metadata();
let mut builder =
SstIndexApplierBuilder::new("test".to_string(), test_object_store(), &metadata);

let eq_expr = DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(field_column()),
op: Operator::Eq,
right: Box::new(string_lit("abc")),
});
let or_eq_list = DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(field_column()),
op: Operator::Eq,
right: Box::new(string_lit("foo")),
})),
op: Operator::Or,
right: Box::new(DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(field_column()),
op: Operator::Eq,
right: Box::new(string_lit("bar")),
})),
});

builder.collect_or_eq_list(&eq_expr, &or_eq_list).unwrap();
assert!(builder.output.is_empty());
}

#[test]
fn test_collect_or_eq_list_nonexistent_column() {
let metadata = test_region_metadata();
let mut builder =
SstIndexApplierBuilder::new("test".to_string(), test_object_store(), &metadata);
let eq_expr = DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(nonexistent_column()),
op: Operator::Eq,
right: Box::new(string_lit("abc")),
});
let or_eq_list = DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(nonexistent_column()),
op: Operator::Eq,
right: Box::new(string_lit("foo")),
})),
op: Operator::Or,
right: Box::new(DfExpr::BinaryExpr(BinaryExpr {
left: Box::new(nonexistent_column()),
op: Operator::Eq,
right: Box::new(string_lit("bar")),
})),
});

let res = builder.collect_or_eq_list(&eq_expr, &or_eq_list);
assert!(matches!(res, Err(Error::ColumnNotFound { .. })));
assert!(builder.output.is_empty());
}
}

0 comments on commit d0da869

Please sign in to comment.