Register the file while computing its start position.
This commit is contained in:
parent
258ace613d
commit
548ba13265
5 changed files with 44 additions and 46 deletions
|
@ -4,7 +4,8 @@ use super::*;
|
|||
fn test_lookup_line() {
|
||||
let source = "abcdefghijklm\nabcdefghij\n...".to_owned();
|
||||
let mut sf =
|
||||
SourceFile::new(FileName::Anon(Hash64::ZERO), source, SourceFileHashAlgorithm::Sha256);
|
||||
SourceFile::new(FileName::Anon(Hash64::ZERO), source, SourceFileHashAlgorithm::Sha256)
|
||||
.unwrap();
|
||||
sf.start_pos = BytePos(3);
|
||||
sf.lines(|lines| {
|
||||
assert_eq!(lines, &[RelativeBytePos(0), RelativeBytePos(14), RelativeBytePos(25)])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue