| 3728 | |
| 3729 | #[test] |
| 3730 | fn parse_call() { |
| 3731 | for test_case in &[ |
| 3732 | "a()", |
| 3733 | "a(b)", |
| 3734 | "a(b, c)", |
| 3735 | "func(b=c)", |
| 3736 | "func(a, b=c, d=e)", |
| 3737 | "func(a, b=c, d=e, *f)", |
| 3738 | "func(a, b=c, d=e, *f, **g)", |
| 3739 | "func(a,)", |
| 3740 | "eval(' '.join(map(chr, [105, 110, 116])))", |
| 3741 | ] { |
| 3742 | let mut parser = Parser::new(test_case); |
| 3743 | let program = parser.parse().expect("parsing failed"); |
| 3744 | |
| 3745 | insta::with_settings!({ |
| 3746 | description => test_case.to_string(), // the template source code |
| 3747 | snapshot_path => "../../test_data/output/", |
| 3748 | omit_expression => true // do not include the default expression |
| 3749 | }, { |
| 3750 | assert_debug_snapshot!(program); |
| 3751 | }); |
| 3752 | } |
| 3753 | } |
| 3754 | |
| 3755 | #[test] |
| 3756 | fn test_lambda() { |