summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/fuzz/src/compile.rs16
-rw-r--r--tests/src/world.rs4
2 files changed, 12 insertions, 8 deletions
diff --git a/tests/fuzz/src/compile.rs b/tests/fuzz/src/compile.rs
index 98c300ce..c9536150 100644
--- a/tests/fuzz/src/compile.rs
+++ b/tests/fuzz/src/compile.rs
@@ -39,16 +39,20 @@ impl World for FuzzWorld {
&self.book
}
- fn main(&self) -> Source {
- self.source.clone()
+ fn main(&self) -> FileId {
+ self.source.id()
}
- fn source(&self, src: FileId) -> FileResult<Source> {
- Err(FileError::NotFound(src.vpath().as_rootless_path().into()))
+ fn source(&self, id: FileId) -> FileResult<Source> {
+ if id == self.source.id() {
+ Ok(self.source.clone())
+ } else {
+ Err(FileError::NotFound(id.vpath().as_rootless_path().into()))
+ }
}
- fn file(&self, src: FileId) -> FileResult<Bytes> {
- Err(FileError::NotFound(src.vpath().as_rootless_path().into()))
+ fn file(&self, id: FileId) -> FileResult<Bytes> {
+ Err(FileError::NotFound(id.vpath().as_rootless_path().into()))
}
fn font(&self, _: usize) -> Option<Font> {
diff --git a/tests/src/world.rs b/tests/src/world.rs
index ad925a53..47b77d7e 100644
--- a/tests/src/world.rs
+++ b/tests/src/world.rs
@@ -43,8 +43,8 @@ impl World for TestWorld {
&self.base.book
}
- fn main(&self) -> Source {
- self.main.clone()
+ fn main(&self) -> FileId {
+ self.main.id()
}
fn source(&self, id: FileId) -> FileResult<Source> {