forked from pierrechevalier83/workstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pierrechevalier83#56 from pierrechevalier83/issue_…
…50_test Add test for issue pierrechevalier83#50
- Loading branch information
Showing
5 changed files
with
117 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
use crate::config::Config; | ||
use crate::pretty_window; | ||
use crate::window_manager::Window; | ||
|
||
const CONFIG_ISSUE_50: &str = "# Config for workstyle | ||
# | ||
# Format: | ||
# \"pattern\" = \"icon\" | ||
# | ||
# The pattern will be used to match against the application name, class_id or WM_CLASS. | ||
# The icon will be used to represent that application. | ||
# | ||
# Note if multiple patterns are present in the same application name, | ||
# precedence is given in order of apparition in this file. | ||
## partials | ||
'/GitHub/' = '' | ||
'/GitLab/' = '' | ||
'/NVIM ?\\w*/' = '' | ||
'/npm/' = '' | ||
'/node/' = '' | ||
'/yarn/' = '' | ||
'/Stack Overflow/' = '' | ||
## browsers | ||
'google-chrome' = '' | ||
'Google-chrome' = '' | ||
'Google-chrome-unstable' = '' | ||
'google-chrome-unstable' = '' | ||
'Google-chrome-beta' = '' | ||
'google-chrome-beta' = '' | ||
'chromium' = '' | ||
'firefox' = '' | ||
'firefoxdeveloperedition' = '' | ||
## default applications | ||
'foot' = '' | ||
'/foot/' = '' | ||
'floating_shell' = '' | ||
'pcmanfm' = '' | ||
'nemo' = '' | ||
'pamac-manager' = '' | ||
'/Bluetooth/' = '' | ||
'file-roller' = '' | ||
'swappy' = '' | ||
'org.kde.okular' = '' | ||
'evince' = '' | ||
'Thunderbird' = '' | ||
'thunderbird' = '' | ||
'evolution' = '' | ||
'kmail' = '' | ||
## ide | ||
'code' = '' | ||
'Code' = '' | ||
'/- Visual Studio Code/' = '' | ||
'/IntelliJ/' = '' | ||
'code-url-handler' = '' | ||
'sublime_text' = '' | ||
# messenger | ||
'whatsapp-for-linux' = '' | ||
'Slack' = '' | ||
'/Telegram/' = '' | ||
'/Microsoft Teams/' = '' | ||
'Signal' = '' | ||
## auth | ||
'polkit-gnome-authentication-agent-1' = '' | ||
'Keybase' = '' | ||
## additional applications | ||
'balena-etcher' = '' | ||
'Steam' = '' | ||
'vlc' = '嗢' | ||
'org.qbittorrent.qBittorrent' = '' | ||
'transmission-gtk' = '' | ||
'Insomnia' = '' | ||
'Bitwarden' = '' | ||
'Spotify' = '' | ||
'YouTube Music' = 'ﱘ' | ||
'alacritty' = '' | ||
'kitty' = '' | ||
'font-manager' = '' | ||
'lutris' = '' | ||
'/Wine/' = '' | ||
'Arctype' = '' | ||
'Around' = '' | ||
[other] | ||
fallback_icon = '' | ||
deduplicate_icons = true"; | ||
|
||
#[test] | ||
fn test_pretty_window() { | ||
let w = Window { | ||
name: Some("Icons Icon | Font Awesome - Chromium".to_string()), | ||
app_id: None, | ||
window_properties_class: Some("chromium".to_string()), | ||
}; | ||
let c = Config::from_str(CONFIG_ISSUE_50).unwrap(); | ||
assert_eq!("", pretty_window(&c, &w)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#[cfg(test)] | ||
mod issue_50; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters