MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_assignments

Function test_assignments

core/src/parser.rs:2218–2243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2216
2217 #[test]
2218 fn test_assignments() {
2219 do_ok_test(
2220 "a=1\nfoo$ = \"bar\"\nb$ = 3 + z",
2221 &[
2222 Statement::Assignment(AssignmentSpan {
2223 vref: VarRef::new("a", None),
2224 vref_pos: lc(1, 1),
2225 expr: expr_integer(1, 1, 3),
2226 }),
2227 Statement::Assignment(AssignmentSpan {
2228 vref: VarRef::new("foo", Some(ExprType::Text)),
2229 vref_pos: lc(2, 1),
2230 expr: expr_text("bar", 2, 8),
2231 }),
2232 Statement::Assignment(AssignmentSpan {
2233 vref: VarRef::new("b", Some(ExprType::Text)),
2234 vref_pos: lc(3, 1),
2235 expr: Expr::Add(Box::from(BinaryOpSpan {
2236 lhs: expr_integer(3, 3, 6),
2237 rhs: expr_symbol(VarRef::new("z", None), 3, 10),
2238 pos: lc(3, 8),
2239 })),
2240 }),
2241 ],
2242 );
2243 }
2244
2245 #[test]
2246 fn test_assignment_errors() {

Callers

nothing calls this directly

Calls 5

lcFunction · 0.85
expr_integerFunction · 0.85
expr_textFunction · 0.85
expr_symbolFunction · 0.85
do_ok_testFunction · 0.70

Tested by

no test coverage detected