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

Function test_pack_four_squares

tests/test_pack.rs:6–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5#[test]
6fn test_pack_four_squares() {
7 let input = b"\
8 POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))\n\
9 POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))\n\
10 POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))\n\
11 POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))\n\
12 ";
13
14 let expected = "\
15 POLYGON((-0.5 -0.5,-0.5 0.5,0.5 0.5,0.5 -0.5,-0.5 -0.5))\n\
16 POLYGON((1.5 -0.5,1.5 0.5,2.5 0.5,2.5 -0.5,1.5 -0.5))\n\
17 POLYGON((-0.5 1.5,-0.5 2.5,0.5 2.5,0.5 1.5,-0.5 1.5))\n\
18 POLYGON((1.5 1.5,1.5 2.5,2.5 2.5,2.5 1.5,1.5 1.5))\n\
19 ";
20
21 let output = tool("pack")
22 .arg("--width=4")
23 .write_stdin(input)
24 .captured_output();
25 assert!(output.status.success());
26 let stdout = String::from_utf8_lossy(&output.stdout);
27 assert_eq!(expected, stdout);
28}

Callers

nothing calls this directly

Calls 2

toolFunction · 0.85
captured_outputMethod · 0.80

Tested by

no test coverage detected