Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chalin opened this issue Nov 28, 2023 · 0 comments · May be fixed by #229
Open

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

chalin opened this issue Nov 28, 2023 · 0 comments · May be fixed by #229

Comments

@chalin
Copy link
Contributor

chalin commented Nov 28, 2023

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

@chalin chalin linked a pull request Nov 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant