-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathui_test.go
More file actions
37 lines (32 loc) · 904 Bytes
/
ui_test.go
File metadata and controls
37 lines (32 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestRenderMarkdown(t *testing.T) {
tests := []struct {
name string
input string
expectError bool
}{
{"simple text", "Hello world", false},
{"markdown formatting", "# Header\n**bold text**", false},
{"empty string", "", false},
{"multiline", "Line 1\nLine 2\nLine 3", false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result, err := renderMarkdown(tt.input)
if tt.expectError {
assert.Error(t, err)
} else {
assert.NoError(t, err)
assert.NotEmpty(t, result)
assert.Contains(t, result, "██╗ ██╗██████╗") // Header should be included
// For markdown rendering, the input gets processed/styled
// so we just check that we got meaningful output
assert.True(t, len(result) > len(tt.input))
}
})
}
}