style: auto-format entire codebase with cargo fmt (stable rustfmt.toml)
Some checks failed
ci/woodpecker/pr/check Pipeline failed
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled

This commit is contained in:
Mikhail Kilin
2026-02-22 17:09:51 +03:00
parent 2442a90e23
commit 264f183510
90 changed files with 1632 additions and 1450 deletions

View File

@@ -1,6 +1,9 @@
// Integration tests for config flow
use tele_tui::config::{AudioConfig, Config, ColorsConfig, GeneralConfig, ImagesConfig, Keybindings, NotificationsConfig};
use tele_tui::config::{
AudioConfig, ColorsConfig, Config, GeneralConfig, ImagesConfig, Keybindings,
NotificationsConfig,
};
/// Test: Дефолтные значения конфигурации
#[test]
@@ -22,9 +25,7 @@ fn test_config_default_values() {
#[test]
fn test_config_custom_values() {
let config = Config {
general: GeneralConfig {
timezone: "+05:00".to_string(),
},
general: GeneralConfig { timezone: "+05:00".to_string() },
colors: ColorsConfig {
incoming_message: "cyan".to_string(),
outgoing_message: "blue".to_string(),
@@ -108,9 +109,7 @@ fn test_parse_color_case_insensitive() {
#[test]
fn test_config_toml_serialization() {
let original_config = Config {
general: GeneralConfig {
timezone: "-05:00".to_string(),
},
general: GeneralConfig { timezone: "-05:00".to_string() },
colors: ColorsConfig {
incoming_message: "cyan".to_string(),
outgoing_message: "blue".to_string(),
@@ -164,25 +163,19 @@ mod timezone_tests {
#[test]
fn test_timezone_formats() {
let positive = Config {
general: GeneralConfig {
timezone: "+03:00".to_string(),
},
general: GeneralConfig { timezone: "+03:00".to_string() },
..Default::default()
};
assert_eq!(positive.general.timezone, "+03:00");
let negative = Config {
general: GeneralConfig {
timezone: "-05:00".to_string(),
},
general: GeneralConfig { timezone: "-05:00".to_string() },
..Default::default()
};
assert_eq!(negative.general.timezone, "-05:00");
let zero = Config {
general: GeneralConfig {
timezone: "+00:00".to_string(),
},
general: GeneralConfig { timezone: "+00:00".to_string() },
..Default::default()
};
assert_eq!(zero.general.timezone, "+00:00");