Skip to content

Commit

Permalink
Merge pull request #383 from visualfc/doc_test
Browse files Browse the repository at this point in the history
TestFuncDoc2
  • Loading branch information
xushiwei authored Feb 16, 2024
2 parents 028ee2b + 8aaca44 commit fa5238f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,23 @@ func main() {
`)
}

func TestFuncDoc2(t *testing.T) {
pkg := newMainPackage()
fn := pkg.NewFunc(nil, "main", nil, nil, false).SetComments(pkg, comment("\n/*\n doc\n*/"))
fn.BodyStart(pkg).End()
if fn.Comments() == nil {
t.Fatal("TestFuncDoc2 failed: no doc?")
}
domTest(t, pkg, `package main
/*
doc
*/
func main() {
}
`)
}

func TestFuncBasic(t *testing.T) {
pkg := newMainPackage()
v := pkg.NewParam(token.NoPos, "v", gox.TyByte)
Expand Down

0 comments on commit fa5238f

Please sign in to comment.