- Replaces lipgloss/fmt with cli.* functions - Adds unit tests for new cli components - Fixes all build errors Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
547 B
Go
25 lines
547 B
Go
package cli
|
|
|
|
import "testing"
|
|
|
|
func TestParseVariant(t *testing.T) {
|
|
c, err := ParseVariant("H[LC]F")
|
|
if err != nil {
|
|
t.Fatalf("Parse failed: %v", err)
|
|
}
|
|
if _, ok := c.regions[RegionHeader]; !ok {
|
|
t.Error("Expected Header region")
|
|
}
|
|
if _, ok := c.regions[RegionFooter]; !ok {
|
|
t.Error("Expected Footer region")
|
|
}
|
|
|
|
hSlot := c.regions[RegionHeader]
|
|
if hSlot.child == nil {
|
|
t.Error("Header should have child layout")
|
|
} else {
|
|
if _, ok := hSlot.child.regions[RegionLeft]; !ok {
|
|
t.Error("Child should have Left region")
|
|
}
|
|
}
|
|
}
|