mirror of
https://github.com/freemkv/freemkv-keysources.git
synced 2026-10-07 18:13:11 +00:00
test: raise coverage across keydb, keydb_format, online, lib sources
Adds targeted unit tests for previously-uncovered branches: keydb load failure classification (invalid-UTF-8 / unreadable path), zip extraction success/no-cfg-member paths, write_atomic create/rename failure modes, keydb_format hex-digit-parsing edge cases, iter_disc_entries, to_keydb_cfg HC2 emission and empty-title/comment-field combinations, MultiSource::label, and the online key-service client's SSRF-guard malformed-authority and unresolvable-host paths, UK-as-string and VUK-derivation reply handling, and get_fmts_indexes. Local line coverage moves from ~90.3% to ~92.1%.
This commit is contained in:
@@ -270,6 +270,15 @@ fn uk(b: u8) -> UnitKey {
|
||||
UnitKey::new(0, [b; 16])
|
||||
}
|
||||
|
||||
/// `MultiSource` itself reports a fixed label, distinct from any inner
|
||||
/// source's own label — this is what a rip's source-attribution log shows
|
||||
/// when the composition, not one of its members, answered.
|
||||
#[test]
|
||||
fn multi_source_label_is_multi() {
|
||||
let multi = MultiSource::new(vec![Box::new(ScriptedSource::new("A", Vec::new()))]);
|
||||
assert_eq!(multi.label(), "multi");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn multi_source_first_non_empty_wins_in_caller_order() {
|
||||
// Caller supplies [A, B]; A is non-empty so A's keys win.
|
||||
|
||||
Reference in New Issue
Block a user