Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)
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>
This commit is contained in:
56
akode-rs/tui/src/clipboard_paste/text_tests.rs
Normal file
56
akode-rs/tui/src/clipboard_paste/text_tests.rs
Normal file
@@ -0,0 +1,56 @@
|
||||
use super::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::time::Duration;
|
||||
|
||||
#[test]
|
||||
fn text_preserves_whitespace_and_rejects_late_or_oversized_reads() {
|
||||
let deadline = Instant::now() + Duration::from_secs(/*secs*/ 5);
|
||||
assert_eq!(
|
||||
validate(" café\r\n\t".into(), deadline),
|
||||
Ok(" café\r\n\t".into())
|
||||
);
|
||||
assert!(validate("late".into(), Instant::now()).is_err());
|
||||
assert!(validate("x".repeat(MAX_USER_INPUT_TEXT_CHARS + 1), deadline).is_err());
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tokio::test]
|
||||
async fn command_drains_large_output_and_bounds_waiting() {
|
||||
use std::process::Stdio;
|
||||
|
||||
let mut child = tokio::process::Command::new("sh")
|
||||
.args([
|
||||
"-c",
|
||||
// Two distinct framed clipboard results, only in response to separate requests.
|
||||
r#"read -r request; printf '\001\000\002\000'; head -c 131072 /dev/zero | tr '\000' x; printf '\n'; read -r request; printf '\010\000\000\000 café\r\n'"#,
|
||||
])
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.kill_on_drop(/*kill_on_drop*/ true)
|
||||
.spawn()
|
||||
.unwrap();
|
||||
let deadline = Instant::now() + Duration::from_secs(/*secs*/ 5);
|
||||
assert_eq!(
|
||||
read_command(&mut child, deadline).await,
|
||||
Ok(format!("{}\n", "x".repeat(/*n*/ 131072)))
|
||||
);
|
||||
assert_eq!(
|
||||
read_command(&mut child, deadline).await,
|
||||
Ok(" café\r\n".into())
|
||||
);
|
||||
let mut child = tokio::process::Command::new("sh")
|
||||
.args(["-c", "exec sleep 10"])
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.kill_on_drop(/*kill_on_drop*/ true)
|
||||
.spawn()
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
read_command(
|
||||
&mut child,
|
||||
Instant::now() + Duration::from_millis(/*millis*/ 20)
|
||||
)
|
||||
.await,
|
||||
Err("clipboard read timed out".into())
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user