text: Wrap BufferId into a newtype

This commit is contained in:
Piotr Osiewicz 2024-01-28 21:05:08 +01:00
parent 941e838be9
commit 5ab715aac9
34 changed files with 687 additions and 383 deletions

View file

@ -314,7 +314,7 @@ mod tests {
use std::assert_eq;
use super::*;
use text::Buffer;
use text::{Buffer, BufferId};
use unindent::Unindent as _;
#[test]
@ -333,7 +333,7 @@ mod tests {
"
.unindent();
let mut buffer = Buffer::new(0, 0, buffer_text);
let mut buffer = Buffer::new(0, BufferId::new(1).unwrap(), buffer_text);
let mut diff = BufferDiff::new();
smol::block_on(diff.update(&diff_base, &buffer));
assert_hunks(
@ -393,7 +393,7 @@ mod tests {
"
.unindent();
let buffer = Buffer::new(0, 0, buffer_text);
let buffer = Buffer::new(0, BufferId::new(1).unwrap(), buffer_text);
let mut diff = BufferDiff::new();
smol::block_on(diff.update(&diff_base, &buffer));
assert_eq!(diff.hunks(&buffer).count(), 8);