wjdp / htmltest

:white_check_mark: Test generated HTML for problems
MIT License
323 stars 54 forks source link

Incorrect total number of documents reported #189

Open MarkvanMents opened 2 years ago

MarkvanMents commented 2 years ago

Describe the bug

The total number of documents scanned is incorrectly reported if

To Reproduce

Steps to reproduce the behaviour:

  1. Run with config and options FilePath: "aSingleFile"

  2. See error tested 6951 documents - should be 1 document

  3. Run with config and options

    IgnoreDirs:
    - "_print"
  4. See error tested 6951 documents - should be 3469 documents as the rest are in the _print directory - (the _print directory is still being ignored as errors there are not reported). (I think this latter bug is a result of #181 ?)

Expected behaviour

I would expect to see the number of documents which were actually tested.

Actual behaviour

Always lists the total number of documents in the documentStore using

// CountDocuments : Return number of documents in hT document store
func (hT *HTMLTest) CountDocuments() int {
    return len(hT.documentStore.Documents)
}

Versions

Additional context

Add any other context about the problem here.