()
| 2165 | |
| 2166 | #[test] |
| 2167 | fn test_array_assignments() { |
| 2168 | do_ok_test( |
| 2169 | "a(1)=100\nfoo(2, 3)=\"text\"\nabc$ (5 + z, 6) = TRUE OR FALSE", |
| 2170 | &[ |
| 2171 | Statement::ArrayAssignment(ArrayAssignmentSpan { |
| 2172 | vref: VarRef::new("a", None), |
| 2173 | vref_pos: lc(1, 1), |
| 2174 | subscripts: vec![expr_integer(1, 1, 3)], |
| 2175 | expr: expr_integer(100, 1, 6), |
| 2176 | }), |
| 2177 | Statement::ArrayAssignment(ArrayAssignmentSpan { |
| 2178 | vref: VarRef::new("foo", None), |
| 2179 | vref_pos: lc(2, 1), |
| 2180 | subscripts: vec![expr_integer(2, 2, 5), expr_integer(3, 2, 8)], |
| 2181 | expr: expr_text("text", 2, 11), |
| 2182 | }), |
| 2183 | Statement::ArrayAssignment(ArrayAssignmentSpan { |
| 2184 | vref: VarRef::new("abc", Some(ExprType::Text)), |
| 2185 | vref_pos: lc(3, 1), |
| 2186 | subscripts: vec![ |
| 2187 | Expr::Add(Box::from(BinaryOpSpan { |
| 2188 | lhs: expr_integer(5, 3, 7), |
| 2189 | rhs: expr_symbol(VarRef::new("z".to_owned(), None), 3, 11), |
| 2190 | pos: lc(3, 9), |
| 2191 | })), |
| 2192 | expr_integer(6, 3, 14), |
| 2193 | ], |
| 2194 | expr: Expr::Or(Box::from(BinaryOpSpan { |
| 2195 | lhs: expr_boolean(true, 3, 19), |
| 2196 | rhs: expr_boolean(false, 3, 27), |
| 2197 | pos: lc(3, 24), |
| 2198 | })), |
| 2199 | }), |
| 2200 | ], |
| 2201 | ); |
| 2202 | } |
| 2203 | |
| 2204 | #[test] |
| 2205 | fn test_array_assignment_errors() { |
nothing calls this directly
no test coverage detected