Skip to content

Commit 89e382c

Browse files
committed
Use dictionary fixtures in the lint CLI test
The deny-network guard caught this in CI: test_check_file_logic built a Codebook that downloads dictionaries, which a warm local cache masked. Verified the rest of the workspace suite passes with a cold cache (XDG_DATA_HOME pointed at an empty dir).
1 parent b54a808 commit 89e382c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

crates/codebook-lsp/src/lint.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,15 @@ mod tests {
421421
let f = dir.path().join("test.txt");
422422
fs::write(&f, "actualbad\n🦀 actualbad").unwrap();
423423

424-
let cb = Codebook::new(Arc::new(CodebookConfigMemory::default())).unwrap();
424+
// Load dictionaries from the codebook crate's checked-in fixtures;
425+
// test builds deny network access (deny-network feature).
426+
let fixtures = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
427+
.join("../codebook/tests/fixtures/dictionaries");
428+
let cb = Codebook::with_dictionary_dir(
429+
Arc::new(CodebookConfigMemory::default()),
430+
Some(fixtures),
431+
)
432+
.unwrap();
425433
let mut seen = HashSet::new();
426434

427435
// Test basic flagging and multi-occurrence counting

0 commit comments

Comments
 (0)