test_positions() — tailwindcss Function Reference
Architecture documentation for the test_positions() function in mod.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD f2abcd97_28a1_dcf7_b230_da1e29c023b0["test_positions()"] 99d2dd55_e7d6_72e7_f911_7a13f8c522f7["get_candidates_with_positions()"] f2abcd97_28a1_dcf7_b230_da1e29c023b0 -->|calls| 99d2dd55_e7d6_72e7_f911_7a13f8c522f7 style f2abcd97_28a1_dcf7_b230_da1e29c023b0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/oxide/src/scanner/mod.rs lines 800–837
fn test_positions() {
let mut scanner = Scanner::new(vec![]);
for (input, expected) in [
// Before migrations
(
r#"<div class="!tw__flex sm:!tw__block tw__bg-gradient-to-t flex tw:[color:red] group-[]:tw__flex"#,
vec![
("class".to_string(), 5),
("!tw__flex".to_string(), 12),
("sm:!tw__block".to_string(), 22),
("tw__bg-gradient-to-t".to_string(), 36),
("flex".to_string(), 57),
("tw:[color:red]".to_string(), 62),
("group-[]:tw__flex".to_string(), 77),
],
),
// After migrations
(
r#"<div class="tw:flex! tw:sm:block! tw:bg-linear-to-t flex tw:[color:red] tw:in-[.tw\:group]:flex"></div>"#,
vec![
("class".to_string(), 5),
("tw:flex!".to_string(), 12),
("tw:sm:block!".to_string(), 21),
("tw:bg-linear-to-t".to_string(), 34),
("flex".to_string(), 52),
("tw:[color:red]".to_string(), 57),
("tw:in-[.tw\\:group]:flex".to_string(), 72),
],
),
] {
let candidates = scanner.get_candidates_with_positions(ChangedContent::Content(
input.to_string(),
"html".into(),
));
assert_eq!(candidates, expected);
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does test_positions() do?
test_positions() is a function in the tailwindcss codebase.
What does test_positions() call?
test_positions() calls 1 function(s): get_candidates_with_positions.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free