Skip to content

Commit

Permalink
fix: test broke becasue of adding . to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TommoLeedsy committed Dec 31, 2023
1 parent 27be767 commit fb1561d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion astTraversal/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ func TestTypeTraverser_Doc(t *testing.T) {
tt := baseTraverser.Type(namedType.Type(), baseTraverser.ActiveFile().Package)
doc, err := tt.Doc()
assert.Nil(t, err)
assert.Equal(t, "MyStruct is a struct", strings.TrimSpace(doc))
assert.Equal(t, "MyStruct is a struct.", strings.TrimSpace(doc))
})
}
8 changes: 4 additions & 4 deletions tests/integration/4-doc-comments/paths_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ func TestPathsDocs(t *testing.T) {
require.False(t, paths.Path("/no-docs.get").Exists("description"))

// GET /pets
require.Equal(t, "getAllPets returns all pets", paths.Path("/pets.get.description").Data().(string))
require.Equal(t, "getAllPets returns all pets.", paths.Path("/pets.get.description").Data().(string))

// POST /pets
require.Equal(t, "createPet creates a pet\nIt takes in a Pet without an ID in the request body", paths.Path("/pets.post.description").Data().(string))
require.Equal(t, "createPet creates a pet.\nIt takes in a Pet without an ID in the request body.", paths.Path("/pets.post.description").Data().(string))

// GET /pets/{id}
require.Equal(t, "getPetByID returns a pet by its ID\nIt takes in the ID as a path parameter", paths.Path("/pets/{id}.get.description").Data().(string))
require.Equal(t, "getPetByID returns a pet by its ID.\nIt takes in the ID as a path parameter.", paths.Path("/pets/{id}.get.description").Data().(string))

// DELETE /pets/{id}
require.Equal(t, "deletePet deletes a pet by its ID\nIt takes in the ID as a path parameter", paths.Path("/pets/{id}.delete.description").Data().(string))
require.Equal(t, "deletePet deletes a pet by its ID.\nIt takes in the ID as a path parameter.", paths.Path("/pets/{id}.delete.description").Data().(string))
}

0 comments on commit fb1561d

Please sign in to comment.