MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / test_all_locations_within

Function test_all_locations_within

battlecode-engine/src/world.rs:2425–2434  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2423
2424 #[test]
2425 fn test_all_locations_within() {
2426 let world = GameWorld::test_world();
2427 let loc = MapLocation::new(Planet::Earth, 2, 4);
2428 let locs = world.all_locations_within(loc, 16);
2429 assert_eq!(locs.len(), 43, "43 locations within 16 distance squared");
2430 for new_loc in locs {
2431 assert_lte!(loc.distance_squared_to(new_loc), 16);
2432 }
2433 assert_eq!(world.all_locations_within(loc, 0), vec![loc]);
2434 }
2435
2436 #[test]
2437 fn test_end_turn_trivial() {

Callers

nothing calls this directly

Calls 1

all_locations_withinMethod · 0.45

Tested by

no test coverage detected