mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-15 01:32:56 +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:
@@ -201,11 +201,11 @@ def test(n):
|
||||
|
||||
// try to find and compile
|
||||
let script = mgr.try_find_script_and_compile(schema, name).await.unwrap();
|
||||
assert!(script.is_some());
|
||||
let _ = script.unwrap();
|
||||
|
||||
{
|
||||
let cached = mgr.compiled.read().unwrap();
|
||||
assert!(cached.get(name).is_some());
|
||||
let _ = cached.get(name).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,6 +512,6 @@ def test(a, b, c, **params):
|
||||
assert_eq!(copr.return_types, vec![None]);
|
||||
assert_eq!(copr.kwarg, Some("params".to_string()));
|
||||
assert_eq!(copr.script, script);
|
||||
assert!(copr.code_obj.is_some());
|
||||
let _ = copr.code_obj.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,6 +345,6 @@ def a(cpu, mem, **kwargs):
|
||||
&HashMap::from([("a".to_string(), "1".to_string())]),
|
||||
);
|
||||
dbg!(&ret);
|
||||
assert!(ret.is_ok());
|
||||
let _ = ret.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ fn run_builtin_fn_testcases() {
|
||||
let loc = loc.to_str().expect("Fail to parse path");
|
||||
let mut file = File::open(loc).expect("Fail to open file");
|
||||
let mut buf = String::new();
|
||||
assert!(file.read_to_string(&mut buf).is_ok());
|
||||
let _ = file.read_to_string(&mut buf).unwrap();
|
||||
let testcases: Vec<TestCase> = from_ron_string(&buf).expect("Fail to convert to testcases");
|
||||
let cached_vm = rustpython_vm::Interpreter::with_init(Default::default(), |vm| {
|
||||
vm.add_native_module("greptime", Box::new(greptime_builtin::make_module));
|
||||
|
||||
@@ -94,7 +94,7 @@ fn run_ron_testcases() {
|
||||
let loc = loc.to_str().expect("Fail to parse path");
|
||||
let mut file = File::open(loc).expect("Fail to open file");
|
||||
let mut buf = String::new();
|
||||
assert!(file.read_to_string(&mut buf).is_ok());
|
||||
let _ = file.read_to_string(&mut buf).unwrap();
|
||||
let testcases: Vec<TestCase> = from_ron_string(&buf).expect("Fail to convert to testcases");
|
||||
info!("Read {} testcases from {}", testcases.len(), loc);
|
||||
for testcase in testcases {
|
||||
|
||||
Reference in New Issue
Block a user