Skip to content

Commit

Permalink
context: one more test
Browse files Browse the repository at this point in the history
with a loop on the left buffer

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
  • Loading branch information
Keruspe committed Jan 26, 2017
1 parent 22c5f02 commit 69120f9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,14 @@ mod tests {
ctx.run_node(&Node::Loop(From::from(vec![Node::Dec, Node::RShift, Node::Inc, Node::LShift])));
assert_eq!(ctx, Context::new_with_data(Vec::new(), vec![0, 2], 0));
}

#[test]
fn test_left_loop() {
let mut ctx = Context::new();
ctx.run_node(&Node::LShift);
ctx.run_node(&Node::Inc);
ctx.run_node(&Node::Inc);
ctx.run_node(&Node::Loop(From::from(vec![Node::Dec, Node::LShift, Node::Inc, Node::RShift])));
assert_eq!(ctx, Context::new_with_data(vec![0, 2], vec![0], -1));
}
}

0 comments on commit 69120f9

Please sign in to comment.