From be98290bbdc6fc7b38f359034d40c7ad9bb98712 Mon Sep 17 00:00:00 2001 From: gwenn Date: Sat, 2 Feb 2019 11:09:00 +0100 Subject: [PATCH] Replace assert! by assert_eq! --- src/functions.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/functions.rs b/src/functions.rs index 81372e1..a94b9a7 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -523,7 +523,7 @@ mod test { use crate::{Connection, Error, Result, NO_PARAMS}; fn half(ctx: &Context<'_>) -> Result { - assert!(ctx.len() == 1, "called with unexpected number of arguments"); + assert_eq!(ctx.len(), 1, "called with unexpected number of arguments"); let value = ctx.get::(0)?; Ok(value / 2f64) } @@ -553,7 +553,7 @@ mod test { // (https://www.sqlite.org/c3ref/get_auxdata.html) to avoid recompiling the regular // expression multiple times within one query. fn regexp_with_auxilliary(ctx: &Context<'_>) -> Result { - assert!(ctx.len() == 2, "called with unexpected number of arguments"); + assert_eq!(ctx.len(), 2, "called with unexpected number of arguments"); let saved_re: Option<&Regex> = ctx.get_aux(0)?; let new_re = match saved_re { @@ -634,7 +634,7 @@ mod test { // until the function is removed. let mut cached_regexes = HashMap::new(); db.create_scalar_function("regexp", 2, true, move |ctx| { - assert!(ctx.len() == 2, "called with unexpected number of arguments"); + assert_eq!(ctx.len(), 2, "called with unexpected number of arguments"); let regex_s = ctx.get::(0)?; let entry = cached_regexes.entry(regex_s.clone());