MCPcopy Create free account
hub / github.com/csskit/csskit / test_contiguous_eager_emission

Function test_contiguous_eager_emission

crates/css_parse/src/cursor_ordered_sink.rs:192–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190
191 #[test]
192 fn test_contiguous_eager_emission() {
193 use crate::{SourceOffset, Token};
194 let bump = Bump::default();
195 let mut output = BumpVec::new_in(&bump);
196 {
197 let mut ordered_sink = CursorOrderedSink::new(&bump, &mut output);
198 // Create cursors that form a contiguous sequence
199 let cursor_at_0 = Cursor::new(SourceOffset(0), Token::SPACE);
200 let cursor_at_1 = Cursor::new(SourceOffset(1), Token::SPACE);
201 ordered_sink.append(cursor_at_0);
202 ordered_sink.append(cursor_at_1);
203 // Avoid flushing as they should be emitted immediately
204 }
205 assert_eq!(output.len(), 2);
206 assert_eq!(output[0].span().start(), SourceOffset(0));
207 assert_eq!(output[1].span().start(), SourceOffset(1));
208 }
209
210 #[test]
211 fn test_gap_filling() {

Callers

nothing calls this directly

Calls 2

SourceOffsetClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected