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

Function test_point2d_to_index

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

Source from the content-addressed store, hash-verified

89
90 #[test]
91 fn test_point2d_to_index() {
92 struct TestMap {}
93 impl BaseMap for TestMap {}
94 impl Algorithm2D for TestMap {
95 fn dimensions(&self) -> Point {
96 Point::new(10, 10)
97 }
98 }
99
100 let map = TestMap {};
101 assert!(map.point2d_to_index(Point::new(0, 0)) == 0);
102 assert!(map.point2d_to_index(Point::new(1, 0)) == 1);
103 assert!(map.point2d_to_index(Point::new(0, 1)) == 10);
104 assert!(map.point2d_to_index(Point::new(9, 9)) == 99);
105 }
106
107 #[test]
108 fn test_index_to_point2d() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected