()
| 4 | |
| 5 | #[test] |
| 6 | fn 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] |
| 36 | fn test_snap_graph_duplicate_nodes() { |
nothing calls this directly
no test coverage detected