Macro assert_tag_is

Source
macro_rules! assert_tag_is {
    ($ctx:tt, T0) => { ... };
    ($ctx:tt, (T0, $microstep:expr)) => { ... };
    ($ctx:tt, T0 + $amount:tt $unit:ident) => { ... };
    ($ctx:tt, (T0 + $amount:tt $unit:ident, $microstep:expr)) => { ... };
}
Expand description

Convenient macro to assert equality of the current tag. This is just shorthand for using assert_eq! with the syntax of tag.


assert_tag_is!(ctx, T0 + 20 ms);
assert_tag_is!(ctx, T0 + 60 ms);
assert_tag_is!(ctx, T0);
// with a microstep, add parentheses
assert_tag_is!(ctx, (T0, 1));
assert_tag_is!(ctx, (T0 + 3 sec, 1));
assert_tag_is!(ctx, (T0 + 3 sec, foo.i));