From 5a0622b9378ed5a3aa42f30f2733fd8cdfc3dbcc Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Tue, 29 Jul 2025 23:12:19 +0530 Subject: [PATCH] add test for subvector method --- core/vector/vector_types.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/vector/vector_types.rs b/core/vector/vector_types.rs index 5ae61ac66..10e0258ce 100644 --- a/core/vector/vector_types.rs +++ b/core/vector/vector_types.rs @@ -636,6 +636,18 @@ mod tests { assert_eq!(result.vector_type, VectorType::Float32); } + #[test] + fn test_subvector() { + let input = "[1.0, 2.0, 3.0, 4.0, 5.0]"; + let value = Value::from_text(input); + let vector = parse_string_vector(VectorType::Float32, &value).unwrap(); + + let result = subvector(&vector, 1, 3).unwrap(); + + assert_eq!(result.dims, 3); + assert_eq!(result.vector_type, VectorType::Float32); + } + #[quickcheck] fn prop_vector_text_roundtrip_2d(v: ArbitraryVector<2>) -> bool { test_vector_text_roundtrip(v.into())