Home / Function/ test_positions() — tailwindcss Function Reference

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
  580d8793_ba3e_2444_5c7d_ac804fed1fd8["test_positions()"]
  d865d4fd_bb15_6d9a_a900_10e82a6856fb["mod.rs"]
  580d8793_ba3e_2444_5c7d_ac804fed1fd8 -->|defined in| d865d4fd_bb15_6d9a_a900_10e82a6856fb
  0f8d329e_0ee0_3682_91d0_989b1ec14827["get_candidates_with_positions()"]
  580d8793_ba3e_2444_5c7d_ac804fed1fd8 -->|calls| 0f8d329e_0ee0_3682_91d0_989b1ec14827
  style 580d8793_ba3e_2444_5c7d_ac804fed1fd8 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

Frequently Asked Questions

What does test_positions() do?
test_positions() is a function in the tailwindcss codebase, defined in crates/oxide/src/scanner/mod.rs.
Where is test_positions() defined?
test_positions() is defined in crates/oxide/src/scanner/mod.rs at line 800.
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