MCPcopy Index your code
hub / github.com/battlecode/battlecode-2018 / test_duration

Function test_duration

battlecode-engine/src/map/mod.rs:669–683  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

667
668 #[test]
669 fn test_duration() {
670 let period = 200;
671 let orbit = OrbitPattern::new(150, period, 250);
672 for i in 0..5 {
673 let base = period * i;
674 assert_eq!(250, orbit.duration(base));
675 assert_eq!(400, orbit.duration(base + period / 4));
676 assert_eq!(250, orbit.duration(base + period / 2));
677 assert_eq!(100, orbit.duration(base + period * 3 / 4));
678 assert_eq!(250, orbit.duration(base + period));
679
680 let duration = orbit.duration(base + period / 8);
681 assert!(duration > 250 && duration < 400);
682 }
683 }
684}

Callers

nothing calls this directly

Calls 1

durationMethod · 0.80

Tested by

no test coverage detected