mirror of
https://github.com/php/pftt2.git
synced 2026-03-24 09:12:17 +01:00
[PR #80] Replace org.apache.regexp package with java.util.regex #107
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/php/pftt2/pull/80
Author: @cmb69
Created: 10/17/2019
Status: 🔄 Open
Base:
master← Head:regex📝 Commits (2)
61ed20cReplace org.apache.regexp package with java.util.regexddf5b24Fix handling of %c%c sequences in EXPECTF sections📊 Changes
14 files changed (+59 additions, -4500 deletions)
View changed files
📝
src/com/github/mattficken/io/StringUtil.java(+3 -9)📝
src/com/mostc/pftt/model/core/PhptTestCase.java(+51 -106)📝
src/com/mostc/pftt/runner/AbstractPhptTestCaseRunner.java(+5 -26)➖
src/com/mostc/pftt/util/apache/regexp/CharacterArrayCharacterIterator.java(+0 -74)➖
src/com/mostc/pftt/util/apache/regexp/CharacterIterator.java(+0 -40)➖
src/com/mostc/pftt/util/apache/regexp/RE.java(+0 -1830)➖
src/com/mostc/pftt/util/apache/regexp/RECompiler.java(+0 -1468)➖
src/com/mostc/pftt/util/apache/regexp/REDebugCompiler.java(+0 -283)➖
src/com/mostc/pftt/util/apache/regexp/REProgram.java(+0 -182)➖
src/com/mostc/pftt/util/apache/regexp/RESyntaxException.java(+0 -41)➖
src/com/mostc/pftt/util/apache/regexp/REUtil.java(+0 -59)➖
src/com/mostc/pftt/util/apache/regexp/ReaderCharacterIterator.java(+0 -163)➖
src/com/mostc/pftt/util/apache/regexp/StreamCharacterIterator.java(+0 -159)➖
src/com/mostc/pftt/util/apache/regexp/StringCharacterIterator.java(+0 -60)📄 Description
The former is ancient, unmaintained, non-standard, and doesn't really
support Perl regular expressions (which may be used by PHPTs), and
appears to be grossly buggy. Therefore we replace it with the Java SE
regular expression package, which is already used elsewhere anyway.
We also simplify the conversion of EXPECTF strings to regexps by doing
simple string replacements instead of regexp replacements, and make the
matching more strict by actually anchoring the pattern to avoid false
negatives.
Finally, we remove the regex debug stuff, since none of it is supported
by java.util.regex; if necessary, we will have to use a debugger.
This fixes #79.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.