MCPcopy Create free account
hub / github.com/github/gh-aw / TestRemoveXMLComments

Function TestRemoveXMLComments

pkg/workflow/xml_comments_test.go:14–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestRemoveXMLComments(t *testing.T) {
15 tests := []struct {
16 name string
17 input string
18 expected string
19 }{
20 {
21 name: "No XML comments",
22 input: "This is regular markdown content",
23 expected: "This is regular markdown content",
24 },
25 {
26 name: "Single line XML comment",
27 input: "Before <!-- this is a comment --> after",
28 expected: "Before after",
29 },
30 {
31 name: "XML comment at start of line",
32 input: "<!-- comment at start --> content",
33 expected: " content",
34 },
35 {
36 name: "XML comment at end of line",
37 input: "content <!-- comment at end -->",
38 expected: "content ",
39 },
40 {
41 name: "Entire line is XML comment",
42 input: "<!-- entire line comment -->",
43 expected: "",
44 },
45 {
46 name: "Multiple XML comments on same line",
47 input: "<!-- first --> middle <!-- second --> end",
48 expected: " middle end",
49 },
50 {
51 name: "Multiline XML comment",
52 input: `Before comment
53<!-- this is a
54multiline comment
55that spans multiple lines -->
56After comment`,
57 expected: `Before comment
58
59After comment`,
60 },
61 {
62 name: "Multiple separate XML comments",
63 input: `First line
64<!-- comment 1 -->
65Middle line
66<!-- comment 2 -->
67Last line`,
68 expected: `First line
69
70Middle line
71

Callers

nothing calls this directly

Calls 3

removeXMLCommentsFunction · 0.70
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected