Provides a test for and the solution to GitHub
issue #242. Namely, an identifier which contains
regex characters (e.g. "[TODO]") is properly
handled by having the parser look for literal
"[" and "]" characters rather than treating those
characters as part of a regex pattern. The word
boundary regex pattern '\b' does NOT properly
handle this, so a slightly different pattern is
used to identify the boundary.
The diff file has a couple of hunks which for
some unknown reason have parsing issues which
result in the wrong line being detected for where
the TODO is. This causes the issue URL insertion
to fail. That's its own issue that should be
investigated, but in order to allow the process_diff
unit test to pass, the diff file is being split
into two to isolate the trouble-causing hunks.
test_new.diff had some issues which would cause
errors if trying to actually use the diff file
with 'patch' to create the files it references.
1) had some line numbers which were invalid
2) had path specifications and, unfortunately,
'patch' does not support creating absent directories
The file has been cleaned up to have the create
line numbers and to assume that all files are at
the root.
Additionally, for the few cases where the diff
file referred to an edit rather than creation of a
whole new file, those diff hunks were moved into a
new, separate, file.
There is no functional change with this commit,
but it sets up future test features.
CustomLanguageTest was modifying a few environment
variables and not restoring them when complete. This
led to problems for later tests that expected those
variables to be at their default values.