mirror of
https://github.com/laosb/SwiftTailwind.git
synced 2025-11-28 22:01:38 +00:00
- Simplify glob handling in TailwindCSSBuildPlugin to support ** patterns - Update README and Tailwind.css example to clarify glob usage - Add Template.swift example using Tailwind classes - Extend tests to verify class extraction from globbed Swift files
29 lines
791 B
Swift
29 lines
791 B
Swift
import Testing
|
|
|
|
@testable import SwiftTailwindExample
|
|
|
|
@Suite("SwiftTailwindExample")
|
|
struct SwiftTailwindExampleTests {
|
|
@Test
|
|
func example() throws {
|
|
let example = Example()
|
|
let generatedCSS = try example.getGeneratedCSS()
|
|
#expect(generatedCSS != nil)
|
|
#expect(
|
|
generatedCSS?.contains("text-2xl") == true,
|
|
"Class used in Swift code is generated."
|
|
)
|
|
#expect(
|
|
generatedCSS?.contains("text-\\[\\#f05138\\]") == true,
|
|
"Arbitary value class used in Test.html is generated."
|
|
)
|
|
#expect(
|
|
generatedCSS?.contains("bg-red-100") == true,
|
|
"Arbitary value class used in Folder/Template.swift is generated."
|
|
)
|
|
#expect(
|
|
generatedCSS?.contains("bg-blue-500") == false,
|
|
"Class not used is not generated."
|
|
)
|
|
}
|
|
}
|