add test for subvector method

This commit is contained in:
bit-aloo
2025-07-29 23:12:19 +05:30
parent cae4ead606
commit 5a0622b937

View File

@@ -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())