* Lists many PRs add to: no written lengths, one file per theme (#7747) * xtask lists: the fixed-table allowlist in order, each with its own reason * Lists: the wide-character blocks and the drawing scale presets as slices too (#7747) * Lists: the drawing units test reads UNITS as a slice (#7747)
This commit is contained in:
@@ -18,7 +18,7 @@ use solidcraft_render::{
|
||||
|
||||
use crate::{Result, Session, params::bad};
|
||||
|
||||
const KINDS: [&str; 12] = [
|
||||
const KINDS: &[&str] = &[
|
||||
"materials",
|
||||
"lighting",
|
||||
"environments",
|
||||
@@ -45,7 +45,7 @@ fn catalog(kind: &str, command: &str) -> Result<&'static [Value]> {
|
||||
}
|
||||
let cached = CATALOGS.get_or_init(|| {
|
||||
let mut catalogs = BTreeMap::new();
|
||||
for kind in KINDS {
|
||||
for &kind in KINDS {
|
||||
let source = super::library_data::catalog(kind).ok_or_else(|| format!("missing built-in catalog {kind}"))?;
|
||||
let value: Value = serde_json::from_str(source).map_err(|e| format!("invalid built-in catalog {kind}: {e}"))?;
|
||||
if !value.get("items").is_some_and(Value::is_array) {
|
||||
|
||||
@@ -14,11 +14,14 @@ fn subject() -> Session {
|
||||
#[test]
|
||||
fn native_studios_resolve_without_mutation_and_apply_one_complete_undo() {
|
||||
let entries = super::entries();
|
||||
assert_eq!(entries.as_array().unwrap().len(), 25);
|
||||
let hdrs: std::collections::BTreeSet<_> = entries.as_array().unwrap().iter().map(|item| item["hdr"].as_str().unwrap()).collect();
|
||||
assert_eq!(hdrs.len(), 24, "every authored HDR has a complete curated composition");
|
||||
for index in 1..=25 {
|
||||
let id = format!("NATIVE-STUDIO-{index:03}");
|
||||
let entries = entries.as_array().unwrap();
|
||||
assert!(!entries.is_empty());
|
||||
let mut ids = std::collections::BTreeSet::new();
|
||||
let hdrs: std::collections::BTreeSet<_> = entries.iter().map(|item| item["hdr"].as_str().unwrap()).collect();
|
||||
assert!(hdrs.len() >= 24, "every authored HDR has a complete curated composition");
|
||||
for entry in entries {
|
||||
let id = entry["id"].as_str().unwrap();
|
||||
assert!(!id.is_empty() && ids.insert(id));
|
||||
let mut s = subject();
|
||||
let before = s.doc.to_json();
|
||||
let undo = s.undo.len();
|
||||
|
||||
Reference in New Issue
Block a user