Skip to content

Commit aa5a3a3

Browse files
committed
Fix test_pool
1 parent cfe7370 commit aa5a3a3

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

Diff for: Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: crates/engine_bibtex/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ tectonic_io_base = { path = "../io_base", version = '0.0.0-dev.0' }
2323
tectonic_bridge_core = { path = "../bridge_core", version = "0.0.0-dev.0" }
2424
tectonic_errors = { path = "../errors", version = "0.0.0-dev.0" }
2525

26+
[dev-dependencies]
27+
tectonic_status_base = { path = "../status_base", version = "0.0.0-dev.0" }
28+
2629
[package.metadata.internal_dep_versions]
2730
tectonic_bridge_core = "thiscommit:2021-01-17:fohCh1sh"
2831
tectonic_errors = "5c9ba661edf5ef669f24f9904f99cca369d999e7"
2932
tectonic_io_base = "0d9169ef44b2652d6d70308a83022bfd60358e71"
33+
tectonic_status_base = "0d9169ef44b2652d6d70308a83022bfd60358e71"

Diff for: crates/engine_bibtex/src/pool.rs

+17-5
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,25 @@ pub(crate) fn add_out_pool(
556556
mod tests {
557557
use super::*;
558558
use crate::BibtexConfig;
559-
use tectonic_bridge_core::{CoreBridgeLauncher, CoreBridgeState, Result};
560-
561-
fn with_cbs<T>(f: impl FnOnce(&mut CoreBridgeState<'_>) -> T) -> Result<T> {
562-
CoreBridgeLauncher::new(&mut [], &mut []).with_global_lock(f)
559+
use tectonic_bridge_core::{CoreBridgeLauncher, CoreBridgeState, MinimalDriver};
560+
use tectonic_io_base::{stack::IoStack, IoProvider};
561+
use tectonic_status_base::NoopStatusBackend;
562+
563+
fn with_cbs(f: impl FnOnce(&mut CoreBridgeState<'_>)) {
564+
let io_list: Vec<&mut dyn IoProvider> = vec![];
565+
let io = IoStack::new(io_list);
566+
let mut hooks = MinimalDriver::new(io);
567+
let mut status = NoopStatusBackend::default();
568+
let mut cbl = CoreBridgeLauncher::new(&mut hooks, &mut status);
569+
cbl.with_global_lock(|cbs| {
570+
f(cbs);
571+
Ok(())
572+
})
573+
.unwrap();
563574
}
564575

576+
// TODO: Create context without backend? Use custom backend-like type?
577+
// Implement the relevant interfaces ourself?
565578
#[test]
566579
fn test_pool() {
567580
with_cbs(|cbs| {
@@ -600,6 +613,5 @@ mod tests {
600613
Err(LookupErr::DoesntExist)
601614
);
602615
})
603-
.unwrap()
604616
}
605617
}

0 commit comments

Comments
 (0)