fix tests
This commit is contained in:
parent
56b5d9f7df
commit
e544b946c9
4 changed files with 44 additions and 4 deletions
|
|
@ -304,4 +304,23 @@ impl PropertyData {
|
|||
price_qualifier: FxHashMap::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Numeric-only instance with explicit quantization params, so tests can
|
||||
/// exercise value decoding via `get_feature`. `values` is row-major u16
|
||||
/// (row * num_features + feat_idx); every feature is treated as numeric.
|
||||
pub(crate) fn numeric_for_tests(
|
||||
values: Vec<u16>,
|
||||
num_features: usize,
|
||||
dequant_a: Vec<f32>,
|
||||
quant_min: Vec<f32>,
|
||||
) -> Self {
|
||||
let mut data = Self::empty_for_tests();
|
||||
data.num_features = num_features;
|
||||
data.num_numeric = num_features;
|
||||
data.quant_range = vec![0.0; num_features];
|
||||
data.dequant_a = dequant_a;
|
||||
data.quant_min = quant_min;
|
||||
data.feature_data = SpillVec::owned(values);
|
||||
data
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,10 +300,11 @@ fn route_seo_tags(
|
|||
let query_e = escape_attr(query_string);
|
||||
// Generated data pages have a clean URL with no query, but their OG card must frame the finding's
|
||||
// map view rather than the default whole-England map. Use the registry's screenshot query.
|
||||
let screenshot_query_base = match crate::generated_data_pages::data_page(trim_trailing_slash(path)) {
|
||||
Some(dp) if !dp.screenshot_query.is_empty() => dp.screenshot_query,
|
||||
_ => query_string,
|
||||
};
|
||||
let screenshot_query_base =
|
||||
match crate::generated_data_pages::data_page(trim_trailing_slash(path)) {
|
||||
Some(dp) if !dp.screenshot_query.is_empty() => dp.screenshot_query,
|
||||
_ => query_string,
|
||||
};
|
||||
let screenshot_query_string = query_string_with_language(screenshot_query_base, language);
|
||||
let screenshot_query_e = escape_attr(&screenshot_query_string);
|
||||
let public_url_e = escape_attr(public_url.trim_end_matches('/'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue