We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fccce2 commit 5d8295aCopy full SHA for 5d8295a
2 files changed
tests/mod.rs
@@ -1,3 +1,4 @@
1
+mod test_attractor;
2
mod test_bundle;
3
#[cfg(feature = "cxx-bindings")]
4
mod test_geom2graph;
tests/test_attractor.rs
@@ -0,0 +1,23 @@
+use pretty_assertions::assert_eq;
+
+use crate::{CommandExt, tool};
5
+#[test]
6
+fn test_attractor_simple() {
7
+ let expected = "\
8
+ POINT(1 2)\n\
9
+ POINT(2 4)\n\
10
+ POINT(3 6)\n\
11
+ ";
12
13
+ let output = tool("attractor")
14
+ .arg("--initial-x=0")
15
+ .arg("--initial-y=0")
16
+ .arg("--math=let x_new = x + 1.0;")
17
+ .arg("--math=let y_new = y + 2.0;")
18
+ .arg("--iterations=3")
19
+ .captured_output();
20
+ assert!(output.status.success());
21
+ let stdout = String::from_utf8_lossy(&output.stdout);
22
+ assert_eq!(expected, stdout);
23
+}
0 commit comments