From bea37e2834a5265035b960277ff27e5f8d74d079 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 21 Feb 2025 14:16:24 +0200 Subject: Start working in new schema logic to core --- log_db/tests/integration.rs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'log_db/tests/integration.rs') diff --git a/log_db/tests/integration.rs b/log_db/tests/integration.rs index 3d71279..af12fb4 100644 --- a/log_db/tests/integration.rs +++ b/log_db/tests/integration.rs @@ -36,6 +36,22 @@ enum Field { Data, } +impl AsRef for Field { + fn as_ref(&self) -> &str { + match self { + Field::Id => "id", + Field::Name => "name", + Field::Data => "data", + } + } +} + +impl Into for Field { + fn into(self) -> String { + self.as_ref().to_owned() + } +} + #[derive(Debug)] struct Inst { pub id: i64, @@ -610,7 +626,7 @@ fn test_batch_find_by() { } let batch: Vec = (2..5).map(Value::Int).collect(); - let result = db.batch_find_by(&Field::Id, &batch).unwrap(); + let result = db.batch_find_by(Field::Id, &batch).unwrap(); assert_eq!(result.len(), batch.len()); assert_eq!( @@ -707,6 +723,23 @@ enum FieldWithNewNullableField { MaybeStr, } +impl AsRef for FieldWithNewNullableField { + fn as_ref(&self) -> &str { + match self { + FieldWithNewNullableField::Id => "id", + FieldWithNewNullableField::Name => "name", + FieldWithNewNullableField::Data => "data", + FieldWithNewNullableField::MaybeStr => "maybe_str", + } + } +} + +impl Into for FieldWithNewNullableField { + fn into(self) -> String { + self.as_ref().to_owned() + } +} + struct InstWithNewNullableField { pub id: i64, pub name: Option, -- cgit v1.3