v0.3.8-pre.011-fix.001

This commit is contained in:
2026-09-03 22:34:02 +02:00
parent 80fe2fd9e2
commit e01fe88594
4 changed files with 66 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-store-desk/tests/release_completeness.rs
// version: 1
// version: 2
//! Release-completeness firewall for the Store Desk V1 RAW surface.
@@ -58,7 +58,12 @@ fn source_segment<'a>(source: &'a str, start: &str, end: &str) -> &'a str {
fn handler_commands(source: &str) -> std::vec::Vec<&str> {
let block = source_segment(source, "tauri::generate_handler![", "]);\n}");
let mut commands = block.lines().map(str::trim).filter(|line| !line.is_empty()).map(|line| line.trim_end_matches(',')).collect::<std::vec::Vec<&str>>();
let mut commands = block
.lines()
.map(str::trim)
.filter(|line| return !line.is_empty())
.map(|line| return line.trim_end_matches(','))
.collect::<std::vec::Vec<&str>>();
commands.sort_unstable();
return commands;
}
@@ -67,8 +72,8 @@ fn crate_modules(source: &str) -> std::vec::Vec<&str> {
let mut modules = source
.lines()
.map(str::trim)
.filter(|line| line.starts_with("mod ") && line.ends_with(';'))
.map(|line| line.trim_start_matches("mod ").trim_end_matches(';'))
.filter(|line| return line.starts_with("mod ") && line.ends_with(';'))
.map(|line| return line.trim_start_matches("mod ").trim_end_matches(';'))
.collect::<std::vec::Vec<&str>>();
modules.sort_unstable();
return modules;
@@ -78,10 +83,10 @@ fn visible_struct_names(source: &str) -> std::vec::Vec<&str> {
let mut names = source
.lines()
.map(str::trim)
.filter(|line| line.starts_with("pub(crate) struct "))
.filter_map(|line| line.strip_prefix("pub(crate) struct "))
.filter_map(|line| line.split_whitespace().next())
.map(|name| name.trim_end_matches('{'))
.filter(|line| return line.starts_with("pub(crate) struct "))
.filter_map(|line| return line.strip_prefix("pub(crate) struct "))
.filter_map(|line| return line.split_whitespace().next())
.map(|name| return name.trim_end_matches('{'))
.collect::<std::vec::Vec<&str>>();
names.sort_unstable();
return names;
@@ -203,8 +208,8 @@ fn pre_011_config_composition_is_exact_network_scoped_and_secret_free() {
let profile_ids = profiles
.iter()
.map(|profile| match profile["profile_id"].as_str() {
std::option::Option::Some(value) => value,
std::option::Option::None => "",
std::option::Option::Some(value) => return value,
std::option::Option::None => return "",
})
.collect::<std::vec::Vec<&str>>();
assert_eq!(profile_ids, ["devnet", "mainnet", "testnet"]);