chore: replace result assertions (#1840)

* s/assert!\((.*)\.is_ok\(\)\);/\1.unwrap\(\);/g

* s/assert!\((.*)\.is_some\(\)\);/\1.unwrap\(\);/g
This commit is contained in:
Lei, HUANG
2023-06-27 19:14:48 +08:00
committed by GitHub
parent b737a240de
commit f287d3115b
92 changed files with 269 additions and 304 deletions

View File

@@ -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()
}

View File

@@ -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();

View File

@@ -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();
}
}

View File

@@ -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)
}