mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-23 08:20:36 +00:00
chore: replace result assertions (#1840)
* s/assert!\((.*)\.is_ok\(\)\);/\1.unwrap\(\);/g * s/assert!\((.*)\.is_some\(\)\);/\1.unwrap\(\);/g
This commit is contained in:
@@ -415,7 +415,7 @@ mod tests {
|
||||
table_id: NUMBERS_TABLE_ID,
|
||||
table: Arc::new(NumbersTable::default()),
|
||||
};
|
||||
assert!(catalog_manager.register_table(req).await.is_ok());
|
||||
let _ = catalog_manager.register_table(req).await.unwrap();
|
||||
|
||||
QueryEngineFactory::new(catalog_manager, false).query_engine()
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ mod test {
|
||||
.unwrap();
|
||||
|
||||
let context = OptimizerContext::default();
|
||||
assert!(OrderHintRule.try_optimize(&plan, &context).is_ok());
|
||||
let _ = OrderHintRule.try_optimize(&plan, &context).unwrap();
|
||||
|
||||
// should read the first (with `.sort(true, false)`) sort option
|
||||
let scan_req = adapter.get_scan_req();
|
||||
|
||||
@@ -57,8 +57,7 @@ mod tests {
|
||||
fn test_validate_catalog_and_schema() {
|
||||
let context = Arc::new(QueryContext::with("greptime", "public"));
|
||||
|
||||
let re = validate_catalog_and_schema("greptime", "public", &context);
|
||||
assert!(re.is_ok());
|
||||
validate_catalog_and_schema("greptime", "public", &context).unwrap();
|
||||
let re = validate_catalog_and_schema("greptime", "wrong_schema", &context);
|
||||
assert!(re.is_err());
|
||||
let re = validate_catalog_and_schema("wrong_catalog", "public", &context);
|
||||
@@ -66,6 +65,6 @@ mod tests {
|
||||
let re = validate_catalog_and_schema("wrong_catalog", "wrong_schema", &context);
|
||||
assert!(re.is_err());
|
||||
|
||||
assert!(validate_catalog_and_schema("greptime", "information_schema", &context).is_ok());
|
||||
validate_catalog_and_schema("greptime", "information_schema", &context).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ fn catalog_manager() -> Result<Arc<MemoryCatalogManager>> {
|
||||
table_id: NUMBERS_TABLE_ID,
|
||||
table: Arc::new(NumbersTable::default()),
|
||||
};
|
||||
assert!(catalog_manager.register_table_sync(req).is_ok());
|
||||
let _ = catalog_manager.register_table_sync(req).unwrap();
|
||||
|
||||
Ok(catalog_manager)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user