From 75a9d560a69312bcf4dd0b9d3f00564a78e7c120 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 17 Jan 2025 15:43:52 +0200 Subject: Refactor public interface --- log_db/tests/integration.rs | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'log_db/tests') diff --git a/log_db/tests/integration.rs b/log_db/tests/integration.rs index 50f4544..5535adf 100644 --- a/log_db/tests/integration.rs +++ b/log_db/tests/integration.rs @@ -44,11 +44,11 @@ struct Inst { impl Recordable for Inst { type Field = Field; - fn schema() -> Vec<(Self::Field, ValueType)> { + fn schema() -> Vec<(Self::Field, Type)> { vec![ - (Field::Id, ValueType::int()), - (Field::Name, ValueType::string().nullable()), - (Field::Data, ValueType::bytes()), + (Field::Id, Type::int()), + (Field::Name, Type::string().nullable()), + (Field::Data, Type::bytes()), ] } fn primary_key() -> Self::Field { @@ -188,8 +188,8 @@ fn test_get_nonexistant() { struct InstTestNullable {} impl Recordable for InstTestNullable { type Field = Field; - fn schema() -> Vec<(Self::Field, ValueType)> { - vec![(Field::Id, ValueType::int())] + fn schema() -> Vec<(Self::Field, Type)> { + vec![(Field::Id, Type::int())] } fn primary_key() -> Self::Field { Field::Id @@ -219,11 +219,8 @@ fn test_upsert_fails_on_null_in_non_nullable_field() { struct InstTestNumValues {} impl Recordable for InstTestNumValues { type Field = Field; - fn schema() -> Vec<(Self::Field, ValueType)> { - vec![ - (Field::Id, ValueType::int()), - (Field::Name, ValueType::string()), - ] + fn schema() -> Vec<(Self::Field, Type)> { + vec![(Field::Id, Type::int()), (Field::Name, Type::string())] } fn primary_key() -> Self::Field { Field::Id @@ -253,8 +250,8 @@ fn test_upsert_fails_on_invalid_number_of_values() { struct InstTestInvalidType {} impl Recordable for InstTestInvalidType { type Field = Field; - fn schema() -> Vec<(Self::Field, ValueType)> { - vec![(Field::Id, ValueType::int())] + fn schema() -> Vec<(Self::Field, Type)> { + vec![(Field::Id, Type::int())] } fn primary_key() -> Self::Field { Field::Id @@ -325,8 +322,8 @@ struct InstSingleId { impl Recordable for InstSingleId { type Field = Field; - fn schema() -> Vec<(Self::Field, ValueType)> { - vec![(Field::Id, ValueType::int())] + fn schema() -> Vec<(Self::Field, Type)> { + vec![(Field::Id, Type::int())] } fn primary_key() -> Self::Field { Field::Id -- cgit v1.3