@@ -1312,11 +1312,11 @@ mod tests {
13121312 assert ! ( validate_vector_index_method( & None ) . is_ok( ) ) ;
13131313 }
13141314
1315- #[ test]
1315+ #[ test]
13161316 fn test_validate_vector_index_method_rejects_ivfflat ( ) {
13171317 let ivfflat = Some ( VectorIndexMethod :: IvfFlat { lists : Some ( 100 ) } ) ;
13181318 let result = validate_vector_index_method ( & ivfflat) ;
1319-
1319+
13201320 assert ! ( result. is_err( ) ) ;
13211321 let error_msg = format ! ( "{}" , result. unwrap_err( ) ) ;
13221322 assert ! ( error_msg. contains( "IVFFlat vector index method is not supported by Kuzu" ) ) ;
@@ -1336,7 +1336,9 @@ mod tests {
13361336 assert ! ( result. is_ok( ) ) ;
13371337
13381338 let query = cypher. query ;
1339- assert ! ( query. contains( "CALL CREATE_VECTOR_INDEX('documents', 'documents_embedding_vector_idx', 'embedding'" ) ) ;
1339+ assert ! ( query. contains(
1340+ "CALL CREATE_VECTOR_INDEX('documents', 'documents_embedding_vector_idx', 'embedding'"
1341+ ) ) ;
13401342 assert ! ( query. contains( "metric := 'cosine'" ) ) ;
13411343 assert ! ( query. ends_with( ");\n " ) ) ;
13421344 }
@@ -1380,39 +1382,55 @@ mod tests {
13801382 } ;
13811383
13821384 append_create_vector_index ( & mut cypher, "test_table" , & index_def) . unwrap ( ) ;
1383- assert ! ( cypher. query. contains( & format!( "metric := '{}'" , expected_kuzu_metric) ) ) ;
1385+ assert ! (
1386+ cypher
1387+ . query
1388+ . contains( & format!( "metric := '{}'" , expected_kuzu_metric) )
1389+ ) ;
13841390 }
13851391 }
13861392
13871393 #[ test]
13881394 fn test_append_drop_vector_index ( ) {
13891395 let mut cypher = CypherBuilder :: new ( ) ;
1390-
1396+
13911397 let result = append_drop_vector_index ( & mut cypher, "documents" , "embedding" ) ;
13921398 assert ! ( result. is_ok( ) ) ;
13931399
13941400 let query = cypher. query ;
1395- assert_eq ! ( query, "CALL DROP_VECTOR_INDEX('documents', 'documents_embedding_vector_idx');\n " ) ;
1401+ assert_eq ! (
1402+ query,
1403+ "CALL DROP_VECTOR_INDEX('documents', 'documents_embedding_vector_idx');\n "
1404+ ) ;
13961405 }
13971406
13981407 #[ test]
13991408 fn test_vector_index_state_equality ( ) {
14001409 let state1 = VectorIndexState {
14011410 field_name : "embedding" . to_string ( ) ,
14021411 metric : VectorSimilarityMetric :: CosineSimilarity ,
1403- method : Some ( VectorIndexMethod :: Hnsw { m : Some ( 16 ) , ef_construction : Some ( 200 ) } ) ,
1412+ method : Some ( VectorIndexMethod :: Hnsw {
1413+ m : Some ( 16 ) ,
1414+ ef_construction : Some ( 200 ) ,
1415+ } ) ,
14041416 } ;
14051417
14061418 let state2 = VectorIndexState {
14071419 field_name : "embedding" . to_string ( ) ,
14081420 metric : VectorSimilarityMetric :: CosineSimilarity ,
1409- method : Some ( VectorIndexMethod :: Hnsw { m : Some ( 16 ) , ef_construction : Some ( 200 ) } ) ,
1421+ method : Some ( VectorIndexMethod :: Hnsw {
1422+ m : Some ( 16 ) ,
1423+ ef_construction : Some ( 200 ) ,
1424+ } ) ,
14101425 } ;
14111426
14121427 let state3 = VectorIndexState {
14131428 field_name : "embedding" . to_string ( ) ,
14141429 metric : VectorSimilarityMetric :: L2Distance , // Different metric
1415- method : Some ( VectorIndexMethod :: Hnsw { m : Some ( 16 ) , ef_construction : Some ( 200 ) } ) ,
1430+ method : Some ( VectorIndexMethod :: Hnsw {
1431+ m : Some ( 16 ) ,
1432+ ef_construction : Some ( 200 ) ,
1433+ } ) ,
14161434 } ;
14171435
14181436 assert_eq ! ( state1, state2) ;
@@ -1424,7 +1442,10 @@ mod tests {
14241442 let state = VectorIndexState {
14251443 field_name : "embedding" . to_string ( ) ,
14261444 metric : VectorSimilarityMetric :: CosineSimilarity ,
1427- method : Some ( VectorIndexMethod :: Hnsw { m : Some ( 16 ) , ef_construction : Some ( 200 ) } ) ,
1445+ method : Some ( VectorIndexMethod :: Hnsw {
1446+ m : Some ( 16 ) ,
1447+ ef_construction : Some ( 200 ) ,
1448+ } ) ,
14281449 } ;
14291450
14301451 // Test serialization
@@ -1475,8 +1496,16 @@ mod tests {
14751496 #[ test]
14761497 fn test_index_naming_consistency ( ) {
14771498 let test_cases = vec ! [
1478- ( "users" , "profile_embedding" , "users_profile_embedding_vector_idx" ) ,
1479- ( "documents" , "content_vector" , "documents_content_vector_vector_idx" ) ,
1499+ (
1500+ "users" ,
1501+ "profile_embedding" ,
1502+ "users_profile_embedding_vector_idx" ,
1503+ ) ,
1504+ (
1505+ "documents" ,
1506+ "content_vector" ,
1507+ "documents_content_vector_vector_idx" ,
1508+ ) ,
14801509 ( "items" , "embedding" , "items_embedding_vector_idx" ) ,
14811510 ] ;
14821511
0 commit comments