MCPcopy
hub / github.com/swaggo/swag / testFormat

Function testFormat

formatter_test.go:15–19  ·  view source on GitHub ↗
(t *testing.T, filename, contents, want string)

Source from the content-addressed store, hash-verified

13)
14
15func testFormat(t *testing.T, filename, contents, want string) {
16 got, err := NewFormatter().Format(filename, []byte(contents))
17 assert.NoError(t, err)
18 assert.Equal(t, want, string(got))
19}
20
21func Test_FormatMain(t *testing.T) {
22 contents := `package main

Callers 6

Test_FormatMainFunction · 0.85
Test_FormatApiFunction · 0.85
Test_NonSwagCommentFunction · 0.85
Test_EmptyCommentFunction · 0.85
Test_AlignAttributeFunction · 0.85

Calls 2

NewFormatterFunction · 0.85
FormatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…