mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-19 17:34:19 +01:00
add test for subvector method
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user