MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestToTextImgNoAlt

Function TestToTextImgNoAlt

internal/htmlutil/htmlutil_test.go:70–75  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68 {name: "section boundaries", html: `<section>Alpha</section><section>Beta</section>`, want: "Alpha Beta"},
69 {name: "computed block boundaries", html: `<span style="display:block">Alpha</span><span style="display:block">Beta</span>`, want: "Alpha Beta"},
70 {name: "computed inline flow", html: `<div style="display:inline">Alpha</div><div style="display:inline">Beta</div>`, want: "AlphaBeta"},
71 {name: "entities", html: `<p>R&amp;D uses &lt;draft&gt;&nbsp;today</p>`, want: "R&D uses <draft> today"},
72 {name: "line break", html: `<p>First<br>Second</p>`, want: "First Second"},
73 }
74 for _, tt := range tests {
75 t.Run(tt.name, func(t *testing.T) {
76 if got := strings.Join(strings.Fields(MessageSourceText(tt.html)), " "); got != tt.want {
77 t.Errorf("MessageSourceText = %q, want %q", got, tt.want)
78 }

Callers

nothing calls this directly

Calls 1

ToTextFunction · 0.85

Tested by

no test coverage detected