Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai 6b0490cc01 test: make the Copilot home and Python rearrange tests pass on Windows (#8321)
The Copilot home test built an absolute path from /home/test, which has no drive on Windows; it now uses a temp directory. The rearrange test rewrote the file with same-length text inside one mtime tick, which the background scan skips; it now moves the mtime forward.
2026-12-06 10:30:17 +08:00
2 змінених файлів з 12 додано та 3 видалено

No files matched your search

+3 -1
Переглянути файл
@@ -117,7 +117,9 @@ fn sample_price_units() -> Value {
#[test]
fn resolves_copilot_home_from_agent_env_or_user_home() {
let home = std::path::Path::new("/home/test");
// Absolute on every platform: `/home/test` has no drive on Windows.
let home_dir = std::env::temp_dir().join("copilot-home-test");
let home = home_dir.as_path();
assert_eq!(
super::config_dir(&[("COPILOT_HOME".into(), "/custom/copilot".into())], Some(home)).as_deref(),
Some(std::path::Path::new("/custom/copilot"))
+9 -2
Переглянути файл
@@ -338,10 +338,17 @@ async fn rearrange_returns_utf16_edits_that_put_methods_in_order() {
"class Board:\n def __init__(self):\n self.名前 = 1 # 初始化\n\n def 移动(self):\n return '→'\n"
);
// Already in order, or broken: nothing to do.
std::fs::write(&path, rearranged.text()).unwrap();
// The reordered text has the original's length: move the mtime, or a scan that lands in the
// same timestamp tick (common on Windows) keeps the old buffer.
let write_later = |text: &str, secs: u64| {
std::fs::write(&path, text).unwrap();
let file = std::fs::File::options().write(true).open(&path).unwrap();
file.set_modified(std::time::SystemTime::now() + std::time::Duration::from_secs(secs)).unwrap();
};
write_later(&rearranged.text(), 2);
f.sync().await;
assert!(doc_rearrange(&f.host, "main", doc).await.unwrap().is_empty());
std::fs::write(&path, "class A:\n def b(self\n def __init__(self): ...\n").unwrap();
write_later("class A:\n def b(self\n def __init__(self): ...\n", 4);
f.sync().await;
assert!(doc_rearrange(&f.host, "main", doc).await.unwrap().is_empty());
}