Use Freeze
for SourceFile.lines
This commit is contained in:
parent
c5996b80be
commit
f49382c050
11 changed files with 199 additions and 179 deletions
|
@ -7,9 +7,7 @@ fn test_lookup_line() {
|
|||
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)])
|
||||
});
|
||||
assert_eq!(sf.lines(), &[RelativeBytePos(0), RelativeBytePos(14), RelativeBytePos(25)]);
|
||||
|
||||
assert_eq!(sf.lookup_line(RelativeBytePos(0)), Some(0));
|
||||
assert_eq!(sf.lookup_line(RelativeBytePos(1)), Some(0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue