Home / Function/ test_ignore_files_can_be_included_with_custom_source_rule() — tailwindcss Function Reference

test_ignore_files_can_be_included_with_custom_source_rule() — tailwindcss Function Reference

Architecture documentation for the test_ignore_files_can_be_included_with_custom_source_rule() function in scanner.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  249b3962_1aa9_80a5_ad4e_015f0db7a813["test_ignore_files_can_be_included_with_custom_source_rule()"]
  6b48c515_a72f_7a7d_7ea7_b80f71a82b19["scanner.rs"]
  249b3962_1aa9_80a5_ad4e_015f0db7a813 -->|defined in| 6b48c515_a72f_7a7d_7ea7_b80f71a82b19
  56624ac4_6945_32d1_2b96_700de264829d["create_files_in()"]
  249b3962_1aa9_80a5_ad4e_015f0db7a813 -->|calls| 56624ac4_6945_32d1_2b96_700de264829d
  0ffee7bc_8829_8e8e_00ee_4a8f4e4d9736["public_source_entry_from_pattern()"]
  249b3962_1aa9_80a5_ad4e_015f0db7a813 -->|calls| 0ffee7bc_8829_8e8e_00ee_4a8f4e4d9736
  89cd8369_536c_74e5_91d1_719df04e4597["scan()"]
  249b3962_1aa9_80a5_ad4e_015f0db7a813 -->|calls| 89cd8369_536c_74e5_91d1_719df04e4597
  style 249b3962_1aa9_80a5_ad4e_015f0db7a813 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/tests/scanner.rs lines 1297–1354

    fn test_ignore_files_can_be_included_with_custom_source_rule() {
        // Create a temporary working directory
        let dir = tempdir().unwrap().into_path();

        // Create files
        create_files_in(
            &dir,
            &[("src/keep-me.html", "content-['src/keep-me.html']")],
        );

        let mut scanner = Scanner::new(vec![
            public_source_entry_from_pattern(dir.clone(), "@source '**/*.html'"),
            public_source_entry_from_pattern(
                dir.clone(),
                "@source not 'src/ignored-by-source-not.html'",
            ),
        ]);

        let candidates = scanner.scan();
        assert_eq!(candidates, vec!["content-['src/keep-me.html']"]);

        // Create new files that should definitely be ignored
        create_files_in(
            &dir,
            &[
                // Create new file that matches the `@source '…'` glob
                ("src/new-file.html", "content-['src/new-file.html']"),
                // Create new file that is ignored based on file extension
                (
                    "src/ignore-by-extension.bin",
                    "content-['src/ignore-by-extension.bin']",
                ),
                // Create a file that is ignored based on the `.gitignore` file
                (".gitignore", "src/ignored-by-gitignore.html"),
                (
                    "src/ignored-by-gitignore.html",
                    "content-['src/ignored-by-gitignore.html']",
                ),
                // Create a file that is ignored by the `@source not '…'`
                (
                    "src/ignored-by-source-not.html",
                    "content-['src/ignored-by-source-not.html']",
                ),
            ],
        );

        let candidates = scanner.scan();

        assert_eq!(
            candidates,
            vec![
                // Ignored by git ignore BUT included by `@source "**/*.html"`
                "content-['src/ignored-by-gitignore.html']",
                "content-['src/keep-me.html']",
                "content-['src/new-file.html']"
            ]
        );
    }

Domain

Subdomains

Frequently Asked Questions

What does test_ignore_files_can_be_included_with_custom_source_rule() do?
test_ignore_files_can_be_included_with_custom_source_rule() is a function in the tailwindcss codebase, defined in crates/oxide/tests/scanner.rs.
Where is test_ignore_files_can_be_included_with_custom_source_rule() defined?
test_ignore_files_can_be_included_with_custom_source_rule() is defined in crates/oxide/tests/scanner.rs at line 1297.
What does test_ignore_files_can_be_included_with_custom_source_rule() call?
test_ignore_files_can_be_included_with_custom_source_rule() calls 3 function(s): create_files_in, public_source_entry_from_pattern, scan.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free