()
| 232 | |
| 233 | #[test] |
| 234 | fn test_sequential() { |
| 235 | use crate::{SourceOffset, Token}; |
| 236 | let bump = Bump::default(); |
| 237 | let mut output = BumpVec::new_in(&bump); |
| 238 | { |
| 239 | let mut ordered_sink = CursorOrderedSink::new(&bump, &mut output); |
| 240 | let cursor1 = Cursor::new(SourceOffset(0), Token::SPACE); |
| 241 | let cursor2 = Cursor::new(SourceOffset(1), Token::SPACE); |
| 242 | let cursor3 = Cursor::new(SourceOffset(2), Token::SPACE); |
| 243 | ordered_sink.append(cursor1); |
| 244 | ordered_sink.append(cursor2); |
| 245 | ordered_sink.append(cursor3); |
| 246 | // Avoid flushing as they should be emitted immediately |
| 247 | } |
| 248 | assert_eq!(output.len(), 3); |
| 249 | assert_eq!(output[0].span().start(), SourceOffset(0)); |
| 250 | assert_eq!(output[1].span().start(), SourceOffset(1)); |
| 251 | assert_eq!(output[2].span().start(), SourceOffset(2)); |
| 252 | } |
| 253 | |
| 254 | #[test] |
| 255 | fn test_varied_order() { |
nothing calls this directly
no test coverage detected