MCPcopy Create free account
hub / github.com/Notgnoshi/generative / test_snap_graph_closest_complex

Function test_snap_graph_closest_complex

generative/snap.rs:547–573  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

545
546 #[test]
547 fn test_snap_graph_closest_complex() {
548 let tgf = b"\
549 0\tPOINT(-0.1 0)\n\
550 1\tPOINT(0 0)\n\
551 2\tPOINT(0 0.1)\n\
552 3\tPOINT(0 -0.1)\n\
553 4\tPOINT(2 0)\n\
554 #\n\
555 0\t1\n\
556 2\t1\n\
557 3\t1\n\
558 1\t4\n\
559 ";
560 let graph = read_tgf_graph::<Undirected, _>(&tgf[..]);
561
562 let expected_tgf = "\
563 0\tPOINT(2 0)\n\
564 1\tPOINT(0 -0.1)\n\
565 #\n\
566 1\t0\n\
567 ";
568
569 let actual = snap_graph(graph, SnappingStrategy::ClosestPoint(0.11));
570
571 let actual_tgf = get_tgf(&actual);
572 assert_eq!(expected_tgf, actual_tgf);
573 }
574
575 #[test]
576 fn test_snap_duplicate_vertices_crash() {

Callers

nothing calls this directly

Calls 2

snap_graphFunction · 0.85
get_tgfFunction · 0.85

Tested by

no test coverage detected