Skip to content

Commit 007c6cf

Browse files
committed
Add description to tests
1 parent a7936db commit 007c6cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test-crawler/crawler_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@ func TestCrawlSingleFileForFunctions(t *testing.T) {
2121
t.Errorf("got %q, expected %q methods", len(fnsAnn), 2)
2222
}
2323

24+
assert.Equal(t, "", fnsAnn[0].Description)
2425
assert.Equal(t, "HelloEvent", fnsAnn[0].Name)
2526
assert.Equal(t, "()", fnsAnn[0].InputParams) // input param
2627
assert.Equal(t, "string", fnsAnn[0].ReturnValues) // return param
2728

29+
assert.Equal(t, "", fnsAnn[1].Description)
2830
assert.Equal(t, "HelloEventWithParameter", fnsAnn[1].Name)
2931
assert.Equal(t, "(param string)", fnsAnn[1].InputParams)
3032
assert.Equal(t, "(string, error)", fnsAnn[1].ReturnValues)
3133

34+
assert.Equal(t, "", fnsAnn[2].Description)
3235
assert.Equal(t, "FunctionWithoutParameters", fnsAnn[2].Name)
3336
assert.Equal(t, "()", fnsAnn[2].InputParams)
3437
assert.Equal(t, "", fnsAnn[2].ReturnValues)
3538

39+
assert.Equal(t, "", fnsAnn[3].Description)
3640
assert.Equal(t, "FunctionWithPointerReturnValue", fnsAnn[3].Name)
3741
assert.Equal(t, "()", fnsAnn[3].InputParams)
3842
assert.Equal(t, "*Event", fnsAnn[3].ReturnValues)
@@ -46,15 +50,15 @@ func TestMakeYAML(t *testing.T) {
4650
Name: "SomeName",
4751
InputParams: "(ctx context.Context, param Parameters)",
4852
ReturnValues: "error",
49-
Description: "",
53+
Description: "SomeComment",
5054
Public: true,
5155
},
5256
{
5357
ID: 2,
5458
Name: "SomeName2",
5559
InputParams: "(ctx context.Context, param2 Parameters2)",
5660
ReturnValues: "error",
57-
Description: "",
61+
Description: "SomeComment2",
5862
Public: true,
5963
},
6064
}

0 commit comments

Comments
 (0)