File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33/usr/share/icons/hicolor/scalable/apps/com.system76.CosmicLauncher.svg
44/usr/share/icons/hicolor/symbolic/apps/com.system76.CosmicLauncher-symbolic.svg
55/usr/share/metainfo/com.system76.CosmicLauncher.metainfo.xml
6- data/cosmic/com.system76.CosmicLauncher/v1/window_switcher
Original file line number Diff line number Diff line change @@ -155,6 +155,51 @@ impl FromStr for LauncherTasks {
155155 }
156156}
157157
158+ #[ cfg( test) ]
159+ mod tests {
160+ use super :: * ;
161+
162+ #[ test]
163+ fn parse_launcher_action_accepts_kebab_case ( ) {
164+ assert ! ( matches!(
165+ parse_launcher_action( "alt-tab-workspace" , & [ ] ) ,
166+ Ok ( LauncherTasks :: AltTabWorkspace )
167+ ) ) ;
168+ }
169+
170+ #[ test]
171+ fn parse_launcher_action_accepts_json_variant ( ) {
172+ assert ! ( matches!(
173+ parse_launcher_action( "\" AltTabAll\" " , & [ ] ) ,
174+ Ok ( LauncherTasks :: AltTabAll )
175+ ) ) ;
176+ }
177+
178+ #[ test]
179+ fn parse_launcher_action_accepts_input_with_args ( ) {
180+ let cmd = parse_launcher_action ( "Input" , & [ "firefox" . into ( ) ] ) . unwrap ( ) ;
181+ assert ! ( matches!(
182+ cmd,
183+ LauncherTasks :: Input {
184+ input: Some ( ref value)
185+ } if value == "firefox"
186+ ) ) ;
187+ }
188+
189+ #[ test]
190+ fn workspace_filter_maps_alt_tab_to_config_default ( ) {
191+ let config = WindowSwitcher :: default ( ) ;
192+ assert_eq ! (
193+ LauncherTasks :: AltTab . workspace_filter( & config) ,
194+ WorkspaceFilter :: All
195+ ) ;
196+ assert_eq ! (
197+ LauncherTasks :: AltTabWorkspace . workspace_filter( & config) ,
198+ WorkspaceFilter :: Current
199+ ) ;
200+ }
201+ }
202+
158203impl CosmicFlags for Args {
159204 type SubCommand = LauncherTasks ;
160205 type Args = Vec < String > ;
You can’t perform that action at this time.
0 commit comments