()
| 4194 | |
| 4195 | #[test] |
| 4196 | fn test_for_incrementing_with_step() { |
| 4197 | let iter = VarRef::new("i", None); |
| 4198 | do_ok_test( |
| 4199 | "FOR i = 0 TO 5 STEP 2\nA\nNEXT", |
| 4200 | &[Statement::For(ForSpan { |
| 4201 | iter: iter.clone(), |
| 4202 | iter_pos: lc(1, 5), |
| 4203 | iter_double: false, |
| 4204 | start: expr_integer(0, 1, 9), |
| 4205 | end: Expr::LessEqual(Box::from(BinaryOpSpan { |
| 4206 | lhs: expr_symbol(iter.clone(), 1, 5), |
| 4207 | rhs: expr_integer(5, 1, 14), |
| 4208 | pos: lc(1, 11), |
| 4209 | })), |
| 4210 | next: Expr::Add(Box::from(BinaryOpSpan { |
| 4211 | lhs: expr_symbol(iter, 1, 5), |
| 4212 | rhs: expr_integer(2, 1, 21), |
| 4213 | pos: lc(1, 11), |
| 4214 | })), |
| 4215 | body: vec![make_bare_builtin_call("A", 2, 1)], |
| 4216 | })], |
| 4217 | ); |
| 4218 | |
| 4219 | let iter = VarRef::new("i", None); |
| 4220 | do_ok_test( |
| 4221 | "FOR i = 0 TO 5 STEP 2.5\nA\nNEXT", |
| 4222 | &[Statement::For(ForSpan { |
| 4223 | iter: iter.clone(), |
| 4224 | iter_pos: lc(1, 5), |
| 4225 | iter_double: true, |
| 4226 | start: expr_integer(0, 1, 9), |
| 4227 | end: Expr::LessEqual(Box::from(BinaryOpSpan { |
| 4228 | lhs: expr_symbol(iter.clone(), 1, 5), |
| 4229 | rhs: expr_integer(5, 1, 14), |
| 4230 | pos: lc(1, 11), |
| 4231 | })), |
| 4232 | next: Expr::Add(Box::from(BinaryOpSpan { |
| 4233 | lhs: expr_symbol(iter, 1, 5), |
| 4234 | rhs: expr_double(2.5, 1, 21), |
| 4235 | pos: lc(1, 11), |
| 4236 | })), |
| 4237 | body: vec![make_bare_builtin_call("A", 2, 1)], |
| 4238 | })], |
| 4239 | ); |
| 4240 | } |
| 4241 | |
| 4242 | #[test] |
| 4243 | fn test_for_decrementing_with_step() { |
nothing calls this directly
no test coverage detected