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

Function test_expr_functions_and_ops

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

Source from the content-addressed store, hash-verified

3470
3471 #[test]
3472 fn test_expr_functions_and_ops() {
3473 use Expr::*;
3474 do_expr_ok_test(
3475 "b AND ask?(34 + 15, ask(1, FALSE), -5)",
3476 And(Box::from(BinaryOpSpan {
3477 lhs: expr_symbol(VarRef::new("b".to_owned(), None), 1, 7),
3478 rhs: Call(CallSpan {
3479 vref: VarRef::new("ask", Some(ExprType::Boolean)),
3480 vref_pos: lc(1, 13),
3481 args: vec![
3482 ArgSpan {
3483 expr: Some(Add(Box::from(BinaryOpSpan {
3484 lhs: expr_integer(34, 1, 18),
3485 rhs: expr_integer(15, 1, 23),
3486 pos: lc(1, 21),
3487 }))),
3488 sep: ArgSep::Long,
3489 sep_pos: lc(1, 25),
3490 },
3491 ArgSpan {
3492 expr: Some(Call(CallSpan {
3493 vref: VarRef::new("ask", None),
3494 vref_pos: lc(1, 27),
3495 args: vec![
3496 ArgSpan {
3497 expr: Some(expr_integer(1, 1, 31)),
3498 sep: ArgSep::Long,
3499 sep_pos: lc(1, 32),
3500 },
3501 ArgSpan {
3502 expr: Some(expr_boolean(false, 1, 34)),
3503 sep: ArgSep::End,
3504 sep_pos: lc(1, 39),
3505 },
3506 ],
3507 })),
3508 sep: ArgSep::Long,
3509 sep_pos: lc(1, 40),
3510 },
3511 ArgSpan {
3512 expr: Some(Negate(Box::from(UnaryOpSpan {
3513 expr: expr_integer(5, 1, 43),
3514 pos: lc(1, 42),
3515 }))),
3516 sep: ArgSep::End,
3517 sep_pos: lc(1, 44),
3518 },
3519 ],
3520 }),
3521 pos: lc(1, 9),
3522 })),
3523 );
3524 }
3525
3526 #[test]
3527 fn test_expr_functions_not_confused_with_symbols() {

Callers

nothing calls this directly

Calls 3

do_expr_ok_testFunction · 0.85
expr_symbolFunction · 0.85
lcFunction · 0.85

Tested by

no test coverage detected