MCPcopy Create free account
hub / github.com/amethyst/bracket-lib / test_index_to_point2d

Function test_index_to_point2d

bracket-algorithm-traits/src/algorithm2d.rs:108–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106
107 #[test]
108 fn test_index_to_point2d() {
109 struct TestMap {}
110 impl BaseMap for TestMap {}
111 impl Algorithm2D for TestMap {
112 fn dimensions(&self) -> Point {
113 Point::new(10, 10)
114 }
115 }
116
117 let map = TestMap {};
118 let mut x = 0;
119 let mut y = 0;
120 for i in 0..100 {
121 assert!(map.index_to_point2d(i) == Point::new(x, y));
122
123 x += 1;
124 if x > 9 {
125 x = 0;
126 y += 1;
127 }
128 }
129 }
130}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected