[jruby-joni] 63/279: Imported Upstream version 1.1.4

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:26:46 UTC 2015


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 d039d7f484475b466e5f60a0b7362979c9f39c97
Author: Torsten Werner <twerner at debian.org>
Date:   Sat Jul 31 19:36:24 2010 +0200

    Imported Upstream version 1.1.4
---
 pom.xml                           |  4 +--
 src/org/joni/ByteCodeMachine.java |  2 ++
 test/org/joni/test/TestJoni.java  |  3 ++
 test/org/joni/test/TestNSU8.java  | 65 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 606f9d9..36af172 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
   <groupId>org.jruby.joni</groupId>
   <artifactId>joni</artifactId>
   <packaging>jar</packaging>
-  <version>1.1.3</version>
+  <version>1.1.4</version>
   <name>Joni</name>
   <description>
     Java port of Oniguruma: http://www.geocities.jp/kosako3/oniguruma
@@ -75,7 +75,7 @@
     <dependency>
        <groupId>org.jruby.jcodings</groupId>
        <artifactId>jcodings</artifactId>
-       <version>1.0.2</version>
+       <version>1.0.4</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
diff --git a/src/org/joni/ByteCodeMachine.java b/src/org/joni/ByteCodeMachine.java
index bcaea73..9ca1988 100644
--- a/src/org/joni/ByteCodeMachine.java
+++ b/src/org/joni/ByteCodeMachine.java
@@ -623,6 +623,7 @@ class ByteCodeMachine extends StackMachine {
         if (s >= range || !isInBitSet()) {opFail(); return;}
         ip += BitSet.BITSET_SIZE;
         s += enc.length(bytes, s, end); /* OP_CCLASS can match mb-code. \D, \S */
+        if (s > end) s = end;
         sprev = sbegin; // break;
     }
     
@@ -672,6 +673,7 @@ class ByteCodeMachine extends StackMachine {
         if (s >= range || isInBitSet()) {opFail(); return;}
         ip += BitSet.BITSET_SIZE;
         s += enc.length(bytes, s, end);
+        if (s > end) s = end;
         sprev = sbegin; // break;
     }
     
diff --git a/test/org/joni/test/TestJoni.java b/test/org/joni/test/TestJoni.java
index 6fb14cc..f1cb9ec 100644
--- a/test/org/joni/test/TestJoni.java
+++ b/test/org/joni/test/TestJoni.java
@@ -7,11 +7,13 @@ public class TestJoni extends TestCase {
     private Test testa;
     private Test testc;
     private Test testu;
+    private Test testnsu8;
     
     protected void setUp() {
         testa = new TestA();
         testc = new TestC();
         testu = new TestU();
+        testnsu8 = new TestNSU8();
     }
     
     protected void tearDown() {
@@ -33,5 +35,6 @@ public class TestJoni extends TestCase {
 
     public void testUnicode() {
         testJoniTest(testu);
+        testJoniTest(testnsu8);
     }
 }
diff --git a/test/org/joni/test/TestNSU8.java b/test/org/joni/test/TestNSU8.java
new file mode 100644
index 0000000..54dd902
--- /dev/null
+++ b/test/org/joni/test/TestNSU8.java
@@ -0,0 +1,65 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of 
+ * this software and associated documentation files (the "Software"), to deal in 
+ * the Software without restriction, including without limitation the rights to 
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
+ * SOFTWARE.
+ */
+package org.joni.test;
+
+import org.joni.Option;
+import org.joni.Syntax;
+import org.jcodings.Encoding;
+import org.jcodings.specific.NonStrictUTF8Encoding;
+
+public class TestNSU8 extends Test {
+
+    public int option() {
+        return Option.DEFAULT;
+    }
+    
+    public Encoding encoding() {
+        return NonStrictUTF8Encoding.INSTANCE;
+    }
+    
+    public String testEncoding() {
+        return "utf-8";
+    }
+    
+    public Syntax syntax() {
+        return Syntax.DEFAULT;
+    }
+    
+    public void test() {
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)240, (byte)32, (byte)32, (byte)32, (byte)32}, 0, 5, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)240, (byte)32, (byte)32, (byte)32}, 0, 4, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)240, (byte)32, (byte)32}, 0, 3, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)240, (byte)32}, 0, 2, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)240}, 0, 1, 1, false);
+
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)224, (byte)32, (byte)32, (byte)32}, 0, 4, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)224, (byte)32, (byte)32}, 0, 3, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)224, (byte)32}, 0, 2, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)224}, 0, 1, 1, false);
+
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)192, (byte)32, (byte)32}, 0, 3, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)192, (byte)32}, 0, 2, 1, false);
+        xx("([^\\[\\]]+)".getBytes(), new byte[]{(byte)192}, 0, 1, 1, false);
+    }
+    
+    public static void main(String[] args) throws Throwable {
+        new TestNSU8().run();
+    }
+}

-- 
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