bevy/crates/bevy_core/src
Martin Dickopp 93cee3b3c9 Make Time::update_with_instant public for use in tests (#4469)
# Objective

To test systems that implement frame rate-independent update logic, one needs to be able to mock `Time`. By mocking time, it's possible to write tests that confirm systems are frame rate-independent.

This is a follow-up PR to #2549 by @ostwilkens and based on his work.

## Solution

To mock `Time`, one needs to be able to manually update the Time resource with an `Instant` defined by the developer. This can be achieved by making the existing `Time::update_with_instant` method public for use in tests. 

## Changelog

- Make `Time::update_with_instant` public
- Add doc to `Time::update_with_instant` clarifying that the method should not be called outside of tests.
- Add doc test to `Time` demonstrating how to use `update_with_instant` in tests.


Co-authored-by: Martin Dickopp <martin@zero-based.org>
2022-04-24 23:15:27 +00:00
..
time Make Time::update_with_instant public for use in tests (#4469) 2022-04-24 23:15:27 +00:00
float_ord.rs small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
lib.rs export TaskPoolThreadAssignmentPolicy (#4145) 2022-03-08 01:54:36 +00:00
name.rs impl more traits for bevy_core::Name (#3611) 2022-02-04 03:07:20 +00:00
task_pool_options.rs use std clamp instead of Bevy's (#1644) 2021-03-13 18:07:14 +00:00