Added unit tests for the new error collection feature.

Tests do not cover the core validation functionality, only check the collection feature, i.e. validates the number and format of returned errors for different examples.