MCPcopy Create free account
hub / github.com/Glyphack/enderpy / test_lambda

Function test_lambda

parser/src/parser/parser.rs:3756–3779  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3754
3755 #[test]
3756 fn test_lambda() {
3757 for test_case in &[
3758 "lambda: a",
3759 "lambda a: a",
3760 "lambda a, b: a",
3761 "lambda a, b, c: a",
3762 "lambda a, *b: a",
3763 "lambda a, *b, c: a",
3764 "lambda a, *b, c, **d: a",
3765 "lambda a=1 : a",
3766 "lambda a=1 : a,",
3767 ] {
3768 let mut parser = Parser::new(test_case);
3769 let program = parser.parse().expect("parsing failed");
3770
3771 insta::with_settings!({
3772 description => test_case.to_string(), // the template source code
3773 snapshot_path => "../../test_data/output/",
3774 omit_expression => true // do not include the default expression
3775 }, {
3776 assert_debug_snapshot!(program);
3777 });
3778 }
3779 }
3780
3781 #[test]
3782 fn test_conditional_expression() {

Callers

nothing calls this directly

Calls 2

expectMethod · 0.80
parseMethod · 0.80

Tested by

no test coverage detected