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

Function test_in_bounds

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

Source from the content-addressed store, hash-verified

73
74 #[test]
75 fn test_in_bounds() {
76 struct TestMap {}
77 impl BaseMap for TestMap {}
78 impl Algorithm2D for TestMap {
79 fn dimensions(&self) -> Point {
80 Point::new(2, 2)
81 }
82 }
83
84 let map = TestMap {};
85 assert!(map.in_bounds(Point::new(0, 0)));
86 assert!(map.in_bounds(Point::new(1, 1)));
87 assert!(!map.in_bounds(Point::new(3, 3)));
88 }
89
90 #[test]
91 fn test_point2d_to_index() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected