The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hyperlane-monorepo/rust/utils/loop-control/tests/integration_tests.rs

34 lines
520 B

use loop_control::{loop_ctrl, LoopControl::*};
#[test]
fn flows_loop() {
let mut i = 0;
for _ in 0..5 {
i += 1;
loop_ctrl!(Flow);
i += 1;
}
assert_eq!(i, 10);
}
#[test]
fn continues_loop() {
let mut i = 0;
for _ in 0..5 {
i += 1;
loop_ctrl!(Continue);
i += 1;
}
assert_eq!(i, 5);
}
#[test]
fn breaks_loop() {
let mut i = 0;
for _ in 0..5 {
i += 1;
loop_ctrl!(Break);
i += 1;
}
assert_eq!(i, 1);
}