Verifying indexer implementations using a shared test suite

In the next few pages, we will be constructing two completely different Indexer implementations. In a similar fashion to the link graph component, we will again devise a shared test suite that will help us verify that both implementations behave in exactly the same way.

The SuiteBase definition for our shared indexer tests can be found in the Chapter06/textindexer/index/indextest package and depends on the gocheck [11] framework that we introduced in Chapter 4The Art of Testing. The suite defines tests for the following groups of index operations:

To create a test suite for an actual indexer implementation, all we have to do is the following: