test_cursor() — tailwindcss Function Reference
Architecture documentation for the test_cursor() function in cursor.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 0a21744e_48e4_3bde_d9fb_c5b306495a47["test_cursor()"] 1d9f0587_3ee2_e78a_02be_cdc4a682af31["advance_by()"] 0a21744e_48e4_3bde_d9fb_c5b306495a47 -->|calls| 1d9f0587_3ee2_e78a_02be_cdc4a682af31 style 0a21744e_48e4_3bde_d9fb_c5b306495a47 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/oxide/src/cursor.rs lines 125–159
fn test_cursor() {
let mut cursor = Cursor::new(b"hello world");
assert_eq!(cursor.pos, 0);
assert!(cursor.at_start);
assert!(!cursor.at_end);
assert_eq!(cursor.prev, 0x00);
assert_eq!(cursor.curr, b'h');
assert_eq!(cursor.next, b'e');
cursor.advance_by(1);
assert_eq!(cursor.pos, 1);
assert!(!cursor.at_start);
assert!(!cursor.at_end);
assert_eq!(cursor.prev, b'h');
assert_eq!(cursor.curr, b'e');
assert_eq!(cursor.next, b'l');
// Advancing too far should stop at the end
cursor.advance_by(10);
assert_eq!(cursor.pos, 11);
assert!(!cursor.at_start);
assert!(cursor.at_end);
assert_eq!(cursor.prev, b'd');
assert_eq!(cursor.curr, 0x00);
assert_eq!(cursor.next, 0x00);
// Can't advance past the end
cursor.advance_by(1);
assert_eq!(cursor.pos, 11);
assert!(!cursor.at_start);
assert!(cursor.at_end);
assert_eq!(cursor.prev, b'd');
assert_eq!(cursor.curr, 0x00);
assert_eq!(cursor.next, 0x00);
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does test_cursor() do?
test_cursor() is a function in the tailwindcss codebase.
What does test_cursor() call?
test_cursor() calls 1 function(s): advance_by.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free