Skip to content

Tests don't take ignored-docs into consideration, and have misleading comments #228

@chalin

Description

@chalin

This is related to:

Consider the following tests:

func TestDocumentStoreDiscover(t *testing.T) {
// documentstore can scan an os directory
dS := NewDocumentStore()
dS.BasePath = "fixtures/documents"
dS.DocumentExtension = ".html" // Ignores .htm
dS.DirectoryIndex = "index.html"
dS.Discover()
// Fixtures dir has eight documents in various folders
assert.Equals(t, "document count", len(dS.Documents), 6)
}
func TestDocumentStoreIgnorePatterns(t *testing.T) {
// documentstore can scan an os directory
dS := NewDocumentStore()
dS.BasePath = "fixtures/documents"
dS.DocumentExtension = ".html" // Ignores .htm
dS.DirectoryIndex = "index.html"
dS.IgnorePatterns = []interface{}{"^lib/"}
dS.Discover()
// Fixtures dir has seven documents in various folders, (one ignored in lib)
assert.Equals(t, "document count", len(dS.Documents), 6)
}

Note, in particular, the following two situations where the comments and code don't match:

The issue runs a deeper that just incorrect comments because the notion of document count has changed since the following fix has landed:

/assign @chalin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions