Add module with optional param syntax test

This commit is contained in:
Agus Zubiaga 2024-05-01 23:43:41 -03:00
parent 370013b960
commit 08825a9e90
No known key found for this signature in database
4 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1 @@
module { x, y ? 0 } -> [menu]

View file

@ -0,0 +1,31 @@
Module {
comments: [],
header: Module(
ModuleHeader {
after_keyword: [],
params: Some(
ModuleParams {
params: [
@9-10 Identifier {
ident: "x",
},
@12-18 OptionalField(
"y",
@17-18 Num(
"0",
),
),
],
before_arrow: [],
after_arrow: [],
},
),
exposes: [
@25-29 ExposedName(
"menu",
),
],
interface_imports: None,
},
),
}

View file

@ -0,0 +1 @@
module { x, y ? 0 } -> [menu]

View file

@ -355,6 +355,7 @@ mod test_snapshots {
pass/module_with_newline.header,
pass/module_with_params.header,
pass/module_with_params_and_multiline_exposes.header,
pass/module_with_optional_param.header,
pass/module_with_multiline_params_and_exposes.header,
pass/multi_backpassing.expr,
pass/multi_backpassing_in_def.moduledefs,