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 24497dbe_24b5_58ff_960d_958eb480879b["test_cursor()"] 38e073c3_a357_d869_e8e1_3fb53595a170["cursor.rs"] 24497dbe_24b5_58ff_960d_958eb480879b -->|defined in| 38e073c3_a357_d869_e8e1_3fb53595a170 d26f6417_a35e_a5f3_1dbc_b1fa869add8c["advance_by()"] 24497dbe_24b5_58ff_960d_958eb480879b -->|calls| d26f6417_a35e_a5f3_1dbc_b1fa869add8c style 24497dbe_24b5_58ff_960d_958eb480879b 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
Defined In
Calls
Source
Frequently Asked Questions
What does test_cursor() do?
test_cursor() is a function in the tailwindcss codebase, defined in crates/oxide/src/cursor.rs.
Where is test_cursor() defined?
test_cursor() is defined in crates/oxide/src/cursor.rs at line 125.
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