Merge pull request '[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/cli/RFC.md fully. Find features des...' (#85) from agent/read---spec-code-core-go-cli-rfc-md-full into dev
All checks were successful
Security Scan / security (push) Successful in 19s
All checks were successful
Security Scan / security (push) Successful in 19s
This commit is contained in:
commit
fb914b99c2
6 changed files with 54 additions and 4 deletions
|
|
@ -38,7 +38,7 @@ func (c *CheckBuilder) Fail() *CheckBuilder {
|
||||||
func (c *CheckBuilder) Skip() *CheckBuilder {
|
func (c *CheckBuilder) Skip() *CheckBuilder {
|
||||||
c.status = "skipped"
|
c.status = "skipped"
|
||||||
c.style = DimStyle
|
c.style = DimStyle
|
||||||
c.icon = "-"
|
c.icon = Glyph(":skip:")
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ func TestCheckBuilder(t *testing.T) {
|
||||||
if got == "" {
|
if got == "" {
|
||||||
t.Error("Empty output for Skip")
|
t.Error("Empty output for Skip")
|
||||||
}
|
}
|
||||||
|
if !strings.Contains(got, "[SKIP]") {
|
||||||
|
t.Error("Expected ASCII skip icon")
|
||||||
|
}
|
||||||
|
|
||||||
// Warn
|
// Warn
|
||||||
c = Check("foo").Warn()
|
c = Check("foo").Warn()
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,8 @@ func Task(label, message string) {
|
||||||
//
|
//
|
||||||
// cli.Section("audit") // ── AUDIT ──
|
// cli.Section("audit") // ── AUDIT ──
|
||||||
func Section(name string) {
|
func Section(name string) {
|
||||||
header := "── " + strings.ToUpper(compileGlyphs(name)) + " ──"
|
dash := Glyph(":dash:")
|
||||||
|
header := dash + dash + " " + strings.ToUpper(compileGlyphs(name)) + " " + dash + dash
|
||||||
fmt.Println(AccentStyle.Render(header))
|
fmt.Println(AccentStyle.Render(header))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,3 +125,19 @@ func TestSemanticOutput_GlyphShortcodes(t *testing.T) {
|
||||||
t.Fatalf("expected progress item shortcode to be rendered, got %q", out)
|
t.Fatalf("expected progress item shortcode to be rendered, got %q", out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSection_GlyphTheme(t *testing.T) {
|
||||||
|
restoreThemeAndColors(t)
|
||||||
|
UseASCII()
|
||||||
|
|
||||||
|
out := captureOutput(func() {
|
||||||
|
Section("audit")
|
||||||
|
})
|
||||||
|
|
||||||
|
if !strings.Contains(out, "-- AUDIT --") {
|
||||||
|
t.Fatalf("expected ASCII section header, got %q", out)
|
||||||
|
}
|
||||||
|
if strings.Contains(out, "── AUDIT ──") {
|
||||||
|
t.Fatalf("expected glyph theme to avoid unicode dashes, got %q", out)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,9 @@ func (c *Composite) renderSeparator(sb *strings.Builder, depth int) {
|
||||||
indent := strings.Repeat(" ", depth)
|
indent := strings.Repeat(" ", depth)
|
||||||
switch currentRenderStyle {
|
switch currentRenderStyle {
|
||||||
case RenderBoxed:
|
case RenderBoxed:
|
||||||
sb.WriteString(indent + "├" + strings.Repeat("─", 40) + "┤\n")
|
sb.WriteString(indent + Glyph(":tee:") + strings.Repeat(Glyph(":dash:"), 40) + Glyph(":tee:") + "\n")
|
||||||
case RenderSimple:
|
case RenderSimple:
|
||||||
sb.WriteString(indent + strings.Repeat("─", 40) + "\n")
|
sb.WriteString(indent + strings.Repeat(Glyph(":dash:"), 40) + "\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
30
pkg/cli/render_test.go
Normal file
30
pkg/cli/render_test.go
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
package cli
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCompositeRender_GlyphTheme(t *testing.T) {
|
||||||
|
prevStyle := currentRenderStyle
|
||||||
|
t.Cleanup(func() {
|
||||||
|
currentRenderStyle = prevStyle
|
||||||
|
})
|
||||||
|
|
||||||
|
restoreThemeAndColors(t)
|
||||||
|
UseASCII()
|
||||||
|
|
||||||
|
c := Layout("HCF")
|
||||||
|
c.H("header").C("content").F("footer")
|
||||||
|
|
||||||
|
UseRenderSimple()
|
||||||
|
out := c.String()
|
||||||
|
assert.Contains(t, out, strings.Repeat("-", 40))
|
||||||
|
|
||||||
|
UseRenderBoxed()
|
||||||
|
out = c.String()
|
||||||
|
assert.Contains(t, out, "+")
|
||||||
|
assert.Contains(t, out, strings.Repeat("-", 40))
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue