1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Bistun Linguistic Metadata Service (LMS)
// Copyright (C) 2026 Francis Xavier Wazeter IV
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Strictly limits this file to the testing compiler pass
//! # Resolver Test Utilities
//! Crate: `bistun-lms`
//! Ref: [LMS-TEST], [012-LMS-ENG]
//! Location: `crates/bistun-lms/src/core/resolver/test_utils.rs`
//!
//! **Why**: Provides a unified set of mocks and generators to ensure hermetic testing of the Taxonomic Engine.
//! **Impact**: Prevents "Mock Drift" across the resolver chain, ensuring that `Alias`, `Exact`, and `Truncation` nodes all test against the same V2.0.0 data structures.
//!
//! ### Glossary
//! * **Mock**: A simulated object that mimics the behavior of real components for isolated testing.
//! * **Stub**: A simple data object used to satisfy type requirements during execution.
use ;
use crateLocaleProfile;
use crateIRegistryState;
use TraitValue;
use ;
use HashMap;
use mock;
use Arc;
// ---------------------------------------------------------
// UNIFIED MOCKS
// ---------------------------------------------------------
mock!
mock!
// ---------------------------------------------------------
// STUB GENERATORS
// ---------------------------------------------------------
/// Generates a "Golden" [`LocaleProfile`] stub for hermetic resolver testing.
///
/// Time: `O(1)` | Space: `O(1)`
///
/// # Logic Trace (Internal)
/// 1. Initialize empty `traits`, `rules`, and `resources` maps to align with V2.0.0 standards.
/// 2. Inject default "Linguistic DNA" (LTR, Space Segmentation, Fusional Morphology).
/// 3. Wrap the resulting [`LocaleProfile`] in an `Arc` for thread-safe Flyweight simulation.
///
/// # Examples
/// ```rust
/// # use crate::bistun_lms::core::resolver::test_utils::create_stub;
/// let profile = create_stub("en-US");
/// assert_eq!(profile.id, "en-US");
/// ```
///
/// # Arguments
/// * `id` (&str): The canonical `BCP 47` identifier for the stub.
///
/// # Returns
/// * `Arc<LocaleProfile>`: An immutable, reference-counted linguistic profile.
///
/// # Golden I/O
/// * **Input**: `"en-US"`
/// * **Output**: `Arc<LocaleProfile { id: "en-US", traits: {...}, ... }>`
///
/// # Errors, Panics, & Safety
/// * **Errors**: None.
/// * **Panics**: None.
/// * **Safety**: Safe synchronous initialization.