Line endings are now preserved during the diff parsing. When the diff
is then rendered later on, we replace non-printable characters by their
ordinal counterparts, so a user can easily grasp changes when a hunk
comes with edits that might be invisible at first.
The expected format for the diff test suite has changed from serialized
PHP to var_export, which is easier readable, editable and understandable,
while still keeping parsable as well.
Support for old Macintosh line endings could not be added, mainly because
modern SCMs do not support single \r in their unified diff output either
and working around and parsing these "lines" would have been a major
headache with not much outcome (given the fact that all Macs that have been
sold since 2001 or 2002 have been BSD-based and as such used Unix line
endings by default).
This commit fixes issue 636.
To run all available tests its enough to call
$ phpunit
from the root workspace directory; the default phpunit configuration
resides in phpunit.xml. A bootstrap script sets some default paths
and can be extended later on with other useful stuff.
Each test class' path should mimic the name and path of the source
class, only that the test class gets an additional "Test" appended so
PHPUnit can find it automatically. The data directory can be used
in a flat manner; for tests that need test data a separate directory
containing these files should be added, and the directory should be
named after the test class itself.
The first test which uses the new infrastructure is a test for the
rewritten diff parser (closes issue 627).