diff --git a/crates/yuck/src/config/snapshots/yuck__config__test__config.snap b/crates/yuck/src/config/snapshots/yuck__config__test__config.snap index 25be93297..7fc51292b 100644 --- a/crates/yuck/src/config/snapshots/yuck__config__test__config.snap +++ b/crates/yuck/src/config/snapshots/yuck__config__test__config.snap @@ -41,6 +41,8 @@ Config( window_definitions: { "some-window": WindowDefinition( name: "some-window", + expected_args: [], + args_span: Span(18446744073709551615, 18446744073709551615, 18446744073709551615), geometry: Some(WindowGeometry( anchor_point: AnchorPoint( x: START, @@ -56,7 +58,7 @@ Config( ), )), stacking: Foreground, - monitor_number: Some(12), + monitor_number: Some(Literal(DynVal("12", Span(278, 280, 0)))), widget: Basic(BasicWidgetUse( name: "bar", attrs: Attributes( @@ -83,6 +85,63 @@ Config( ), ), ), + "some-window-with-args": WindowDefinition( + name: "some-window-with-args", + expected_args: [ + AttrSpec( + name: AttrName("arg"), + optional: false, + span: Span(523, 526, 0), + ), + AttrSpec( + name: AttrName("arg2"), + optional: false, + span: Span(527, 531, 0), + ), + ], + args_span: Span(522, 532, 0), + geometry: Some(WindowGeometry( + anchor_point: AnchorPoint( + x: START, + y: START, + ), + offset: Coords( + x: Pixels(0), + y: Pixels(0), + ), + size: Coords( + x: Percent(12), + y: Pixels(20), + ), + )), + stacking: Foreground, + monitor_number: Some(Literal(DynVal("12", Span(595, 597, 0)))), + widget: Basic(BasicWidgetUse( + name: "bar", + attrs: Attributes( + span: Span(784, 795, 0), + attrs: { + AttrName("arg"): AttrEntry( + key_span: Span(785, 789, 0), + value: SimplExpr(Span(790, 795, 0), Literal(DynVal("bla", Span(790, 795, 0)))), + ), + }, + ), + children: [], + span: Span(780, 796, 0), + name_span: Span(781, 784, 0), + )), + resizable: true, + backend_options: BackendWindowOptions( + wm_ignore: false, + sticky: true, + window_type: Dock, + struts: StrutDefinition( + side: Left, + dist: Pixels(30), + ), + ), + ), }, var_definitions: { VarName("some_var"): VarDefinition( diff --git a/crates/yuck/src/config/test.rs b/crates/yuck/src/config/test.rs index 1af2a6107..f3d53e8c3 100644 --- a/crates/yuck/src/config/test.rs +++ b/crates/yuck/src/config/test.rs @@ -20,6 +20,13 @@ fn test_config() { :geometry (geometry :width "12%" :height "20px") :reserve (struts :side "left" :distance "30px") (bar :arg "bla")) + (defwindow some-window-with-args [arg arg2] + :stacking "fg" + :monitor 12 + :resizable true + :geometry (geometry :width "12%" :height "20px") + :reserve (struts :side "left" :distance "30px") + (bar :arg "bla")) "#; let mut files = YuckFiles::new(); let (span, asts) = files.load_str("config.yuck".to_string(), input.to_string()).unwrap();