diff --git a/src/test_all_types.rs b/src/test_all_types.rs index 5499aab4..893088ac 100644 --- a/src/test_all_types.rs +++ b/src/test_all_types.rs @@ -18,9 +18,6 @@ fn test_all_types() -> crate::Result<()> { // union is currently blocked by https://github.com/duckdb/duckdb/pull/11326 "union", // these remaining types are not yet supported by duckdb-rs - "small_enum", - "medium_enum", - "large_enum", "struct", "struct_of_arrays", "array_of_structs", @@ -349,6 +346,21 @@ fn test_single(idx: &mut i32, column: String, value: ValueRef) { ), _ => assert_eq!(value, ValueRef::Null), }, + "small_enum" => match idx { + 0 => assert_eq!(value.to_owned(), Value::Enum("DUCK_DUCK_ENUM".to_string())), + 1 => assert_eq!(value.to_owned(), Value::Enum("GOOSE".to_string())), + _ => assert_eq!(value, ValueRef::Null), + }, + "medium_enum" => match idx { + 0 => assert_eq!(value.to_owned(), Value::Enum("enum_0".to_string())), + 1 => assert_eq!(value.to_owned(), Value::Enum("enum_1".to_string())), + _ => assert_eq!(value, ValueRef::Null), + }, + "large_enum" => match idx { + 0 => assert_eq!(value.to_owned(), Value::Enum("enum_0".to_string())), + 1 => assert_eq!(value.to_owned(), Value::Enum("enum_69999".to_string())), + _ => assert_eq!(value, ValueRef::Null), + }, _ => todo!("{column:?}"), } } diff --git a/src/types/value_ref.rs b/src/types/value_ref.rs index f1e2d4cd..d520f8f1 100644 --- a/src/types/value_ref.rs +++ b/src/types/value_ref.rs @@ -194,7 +194,8 @@ impl From> for Value { EnumType::UInt16(res) => res.values(), EnumType::UInt32(res) => res.values(), }, - ).to_owned(); + ) + .to_owned(); if let Value::Text(s) = value { Value::Enum(s)