| 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&D uses <draft> 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 | } |