[jruby-joni] 16/31: more tests

Hideki Yamane henrich at moszumanska.debian.org
Sat Feb 24 10:44:58 UTC 2018


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository jruby-joni.

commit fe8e1fc73907caaecb4e42475cdbcec2ccfe2c77
Author: lopex <lopx at gazeta.pl>
Date:   Fri Feb 2 13:42:53 2018 +0100

    more tests
---
 src/org/joni/Lexer.java           | 4 ++--
 test/org/joni/test/TestError.java | 7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/org/joni/Lexer.java b/src/org/joni/Lexer.java
index 35869ad..bd80c21 100644
--- a/src/org/joni/Lexer.java
+++ b/src/org/joni/Lexer.java
@@ -601,7 +601,7 @@ class Lexer extends ScannerSupport {
             unfetch();
             int last = p;
             int num = scanUnsignedOctalNumber(3);
-            if (num < 0) newValueException(ERR_TOO_BIG_NUMBER);
+            if (num < 0 || num > 0xff) newValueException(ERR_TOO_BIG_NUMBER);
             if (p == last) {  /* can't read nothing. */
                 num = 0; /* but, it's not error */
             }
@@ -840,7 +840,7 @@ class Lexer extends ScannerSupport {
         if (syntax.opEscOctal3()) {
             int last = p;
             int num = scanUnsignedOctalNumber(c == '0' ? 2 : 3);
-            if (num < 0) newValueException(ERR_TOO_BIG_NUMBER);
+            if (num < 0 || num > 0xff) newValueException(ERR_TOO_BIG_NUMBER);
             if (p == last) { /* can't read nothing. */
                 num = 0; /* but, it's not error */
             }
diff --git a/test/org/joni/test/TestError.java b/test/org/joni/test/TestError.java
index e0f1347..f520907 100755
--- a/test/org/joni/test/TestError.java
+++ b/test/org/joni/test/TestError.java
@@ -49,9 +49,10 @@ public class TestError extends Test {
     @Override
     public void test() throws Exception {
 	    xerrs("(", ErrorMessages.ERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS);
+	    xerrs("[[:WoRd:]]", ErrorMessages.ERR_INVALID_POSIX_BRACKET_TYPE);
 	    xerrs("(0?0|(?(1)||)|(?(1)||))?", ErrorMessages.ERR_INVALID_CONDITION_PATTERN);
-	    // xerrs("[\\40000000000", ErrorMessages.ERR_TOO_BIG_NUMBER);
-	    // xerrs("[\\40000000000\n", ErrorMessages.ERR_TOO_BIG_NUMBER);
+	    xerrs("[\\40000000000", ErrorMessages.ERR_TOO_BIG_NUMBER);
+	    xerrs("[\\40000000000\n", ErrorMessages.ERR_TOO_BIG_NUMBER);
 	    xerrs("[]", ErrorMessages.ERR_EMPTY_CHAR_CLASS);
 	    xerrs("[c-a]", ErrorMessages.ERR_EMPTY_RANGE_IN_CHAR_CLASS);
 	    xerrs("\\x{FFFFFFFF}", ErrorMessages.ERR_TOO_BIG_WIDE_CHAR_VALUE);
@@ -59,5 +60,7 @@ public class TestError extends Test {
 	    // xerrs("\\u026x", ErrorMessages.ERR_TOO_SHORT_DIGITS);
 	    xerrs("()(?\\!(?'a')\\1)", ErrorMessages.ERR_UNDEFINED_GROUP_OPTION);
 	    xerrs("\\((", ErrorMessages.ERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS);
+	    xerrs("(|", ErrorMessages.ERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS);
+	    xerrs("'/g\\\u00ff\u00ff\u00ff\u00ff&))", ErrorMessages.ERR_UNMATCHED_CLOSE_PARENTHESIS);
     }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git



More information about the pkg-java-commits mailing list