diff options
Diffstat (limited to 'tvix')
-rw-r--r-- | tvix/castore/src/refscan.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tvix/castore/src/refscan.rs b/tvix/castore/src/refscan.rs index 8e6a81b2a4fe..352593020472 100644 --- a/tvix/castore/src/refscan.rs +++ b/tvix/castore/src/refscan.rs @@ -334,5 +334,21 @@ mod tests { } } + #[tokio::test] + async fn test_reference_reader_no_patterns() { + let pattern = ReferencePattern::new(Vec::<&str>::new()); + let scanner = ReferenceScanner::new(pattern); + let mut mock = Builder::new(); + mock.read(HELLO_DRV.as_bytes()); + let mock = mock.build(); + let mut reader = ReferenceReader::new(&scanner, mock); + let mut s = String::new(); + reader.read_to_string(&mut s).await.unwrap(); + assert_eq!(s, HELLO_DRV); + + let result = scanner.finalise(); + assert_eq!(result.len(), 0); + } + // FUTUREWORK: Test with large file } |