use crate::write::ToValkeyArgs;
use bytes::Bytes;
#[track_caller]
pub(crate) fn assert_args_empty(value: impl ToValkeyArgs) {
assert_args(value, &[] as &[&str]);
}
#[track_caller]
pub(crate) fn assert_args<A: AsRef<[u8]>>(value: impl ToValkeyArgs, expected: &[A]) {
let actual: Vec<Bytes> = value
.to_valkey_args()
.into_iter()
.map(Bytes::from)
.collect();
let expected: Vec<Bytes> = expected
.iter()
.map(|arg| Bytes::copy_from_slice(arg.as_ref()))
.collect();
assert_eq!(actual, expected);
assert_eq!(value.num_of_args(), expected.len());
}