fix(test): clippy + fmt fixes for logging_roundtrip and ingest_log_smoke
* kebab-config/tests/logging_roundtrip.rs: r#"..."# → plain string
(clippy::unnecessary_hashes).
* kebab-app/tests/ingest_log_smoke.rs: |e| e.ok() → Result::ok,
|s| s.as_u64() → Value::as_u64 (clippy::redundant_closure).
* cargo fmt --all applied to pre-existing formatting drift.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,18 +2,23 @@
|
||||
//
|
||||
// Integration tests for [logging] config section (v0.20.x ingest log feature).
|
||||
|
||||
use std::path::PathBuf;
|
||||
use kebab_config::{Config, LoggingCfg};
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
struct LoggingWrapper { logging: LoggingCfg }
|
||||
struct LoggingWrapper {
|
||||
logging: LoggingCfg,
|
||||
}
|
||||
|
||||
// Test 1: default LoggingCfg roundtrip — enabled=true, dir="{state_dir}/logs".
|
||||
#[test]
|
||||
fn logging_defaults_are_enabled_with_state_dir_placeholder() {
|
||||
let cfg = Config::defaults();
|
||||
assert!(cfg.logging.ingest_log_enabled);
|
||||
assert_eq!(cfg.logging.ingest_log_dir, PathBuf::from("{state_dir}/logs"));
|
||||
assert_eq!(
|
||||
cfg.logging.ingest_log_dir,
|
||||
PathBuf::from("{state_dir}/logs")
|
||||
);
|
||||
}
|
||||
|
||||
// Test 2: [logging] override — enabled=false, custom dir.
|
||||
@@ -32,9 +37,7 @@ ingest_log_dir = "/tmp/custom-logs"
|
||||
// Test 3: pre-v0.20 config (no [logging] section) → LoggingCfg::default() (AC-10).
|
||||
#[test]
|
||||
fn pre_v020_config_without_logging_section_gets_defaults() {
|
||||
let toml = r#"
|
||||
[logging]
|
||||
"#;
|
||||
let toml = "[logging]\n";
|
||||
let w: LoggingWrapper = toml::from_str(toml).expect("parse toml with empty logging section");
|
||||
assert!(w.logging.ingest_log_enabled);
|
||||
assert_eq!(w.logging.ingest_log_dir, PathBuf::from("{state_dir}/logs"));
|
||||
|
||||
Reference in New Issue
Block a user