MCPcopy Create free account
hub / github.com/GuyARoss/orbit / TestTokenizeCommentString

Function TestTokenizeCommentString

pkg/jsparse/document_test.go:132–156  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func TestTokenizeCommentString(t *testing.T) {
133 var tt = []struct {
134 i string
135 o DefaultJSDocument
136 lineData string
137 }{
138 {`"http://site.com"`, DefaultJSDocument{
139 extension: "jsx",
140 other: []string{""},
141 }, `"http://site.com"`},
142 }
143
144 for _, d := range tt {
145 cdoc := NewEmptyDocument()
146 _, err := cdoc.tokenizeLine(context.TODO(), "", d.i)
147
148 if err != nil {
149 t.Errorf("error not expected %s", err)
150 }
151
152 if cdoc.other[0] != d.lineData {
153 t.Errorf("expected '%s' got '%s'", d.lineData, cdoc.other[0])
154 }
155 }
156}
157
158func TestTokenizeLine(t *testing.T) {
159 var tt = []struct {

Callers

nothing calls this directly

Calls 2

NewEmptyDocumentFunction · 0.85
tokenizeLineMethod · 0.80

Tested by

no test coverage detected