Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
29 lines
912 B
Rust
29 lines
912 B
Rust
//! Protocol fixtures and text assertions shared by test targets.
|
|
|
|
use akode_protocol::ItemIdGenerator;
|
|
use akode_protocol::ResponseItemId;
|
|
use akode_protocol::models::ContentItem;
|
|
use std::sync::Arc;
|
|
|
|
pub fn uuid_v7_item_id_generator_for_test() -> ItemIdGenerator {
|
|
Arc::new(|prefix| ResponseItemId::with_suffix(prefix, uuid::Uuid::now_v7()))
|
|
}
|
|
|
|
/// Assertion helpers for tests that require text rather than media content.
|
|
/// Implementations should fail at the calling assertion for non-text content.
|
|
pub trait ContentItemTestExt {
|
|
/// Extracts text, panicking at the call site when the content is not text.
|
|
#[track_caller]
|
|
fn expect_text(self) -> String;
|
|
}
|
|
|
|
impl ContentItemTestExt for ContentItem {
|
|
#[track_caller]
|
|
fn expect_text(self) -> String {
|
|
match self.into_text() {
|
|
Some(text) => text,
|
|
None => panic!("expected text content"),
|
|
}
|
|
}
|
|
}
|