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

Function test_snap_graph

tests/test_snap.rs:6–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5#[test]
6fn test_snap_graph() {
7 // A few connected nodes close together, and a few close together nodes that aren't connected.
8 let input = b"\
9 0\tPOINT(0 0)\n\
10 2\tPOINT(0 0.05)\n\
11 3\tPOINT(1 1)\n\
12 4\tPOINT(1.05 1)\n\
13 #\n\
14 0\t2\n\
15 0\t3\n\
16 ";
17
18 let expected = "\
19 0\tPOINT(1.05 1)\n\
20 1\tPOINT(0 0.05)\n\
21 #\n\
22 0\t1\n\
23 ";
24
25 let output = tool("snap")
26 .arg("--input-format=tgf")
27 .arg("--tolerance=0.1")
28 .write_stdin(input)
29 .captured_output();
30 assert!(output.status.success());
31 let stdout = String::from_utf8_lossy(&output.stdout);
32 assert_eq!(expected, stdout);
33}
34
35#[test]
36fn test_snap_graph_duplicate_nodes() {

Callers

nothing calls this directly

Calls 2

toolFunction · 0.85
captured_outputMethod · 0.80

Tested by

no test coverage detected