test_string_machine_extraction() — tailwindcss Function Reference
Architecture documentation for the test_string_machine_extraction() function in string_machine.rs from the tailwindcss codebase.
Entity Profile
Relationship Graph
Source Code
crates/oxide/src/extractor/string_machine.rs lines 104–137
fn test_string_machine_extraction() {
for (input, expected) in [
// Simple string
("'foo'", vec!["'foo'"]),
// String as part of a candidate
("content-['hello_world']", vec!["'hello_world'"]),
// With nested quotes
(r#"'"`hello`"'"#, vec![r#"'"`hello`"'"#]),
// With escaped opening quote
(r#"'Tailwind\'s_parser'"#, vec![r#"'Tailwind\'s_parser'"#]),
(
r#"'Tailwind\'\'s_parser'"#,
vec![r#"'Tailwind\'\'s_parser'"#],
),
(
r#"'Tailwind\'\'\'s_parser'"#,
vec![r#"'Tailwind\'\'\'s_parser'"#],
),
(
r#"'Tailwind\'\'\'\'s_parser'"#,
vec![r#"'Tailwind\'\'\'\'s_parser'"#],
),
// Spaces are not allowed
("' hello world '", vec![]),
// With unfinished quote
("'unfinished_quote", vec![]),
// An escape at the end will never be valid, because it _must_ be followed by the
// ending quote.
(r#"'escaped_ending_quote\'"#, vec![]),
(r#"'escaped_end\"#, vec![]),
] {
assert_eq!(StringMachine::test_extract_all(input), expected);
}
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free