Text 174: ScriptStringLookup does not accept ":" (#126)

* Prepare Tests For change

* TEST-174: Limit the number of split to 2

* TEXT-174: Correct CheckStyle Violation

* TEXT-174: Add Test with no column

* TEXT-174: Corrections asked by @kinow

Co-authored-by: furkan-kilic <furkilic@gmail.com>
diff --git a/src/main/java/org/apache/commons/text/lookup/ScriptStringLookup.java b/src/main/java/org/apache/commons/text/lookup/ScriptStringLookup.java
index 701d013..3029d73 100644
--- a/src/main/java/org/apache/commons/text/lookup/ScriptStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/ScriptStringLookup.java
@@ -25,9 +25,9 @@
 import org.apache.commons.text.StringSubstitutor;
 
 /**
- * Looks up keys from an XML document.
+ * Executes the script with the given engine name.
  * <p>
- * Looks up the value for a given key in the format "Document:Key".
+ * Execute the script with the engine name in the format "EngineName:Script".
  * </p>
  * <p>
  * For example: {@code "javascript:3 + 4"}.
@@ -55,24 +55,25 @@
     }
 
     /**
-     * Looks up the value for the key in the format "DocumentPath:XPath".
+     * Execute the script with the engine name in the format "EngineName:Script".
+     * Extra colons will be ignored.
      * <p>
-     * For example: "com/domain/document.xml:/path/to/node".
+     * For example: {@code "javascript:3 + 4"}.
      * </p>
      *
      * @param key
-     *            the key to be looked up, may be null
-     * @return The value associated with the key.
+     *            the engine:script to execute, may be null
+     * @return The value returned by the execution.
      */
     @Override
     public String lookup(final String key) {
         if (key == null) {
             return null;
         }
-        final String[] keys = key.split(SPLIT_STR);
+        final String[] keys = key.split(SPLIT_STR, 2);
         final int keyLen = keys.length;
         if (keyLen != 2) {
-            throw IllegalArgumentExceptions.format("Bad script key format [%s]; expected format is DocumentPath:Key.",
+            throw IllegalArgumentExceptions.format("Bad script key format [%s]; expected format is EngineName:Script.",
                     key);
         }
         final String engineName = keys[0];
diff --git a/src/test/java/org/apache/commons/text/lookup/ScriptStringLookupTest.java b/src/test/java/org/apache/commons/text/lookup/ScriptStringLookupTest.java
index 2d8d73a..1680f90 100644
--- a/src/test/java/org/apache/commons/text/lookup/ScriptStringLookupTest.java
+++ b/src/test/java/org/apache/commons/text/lookup/ScriptStringLookupTest.java
@@ -58,4 +58,17 @@
         Assertions.assertEquals("Hello World!", ScriptStringLookup.INSTANCE.lookup("javascript:\"Hello World!\""));
     }
 
+    @Test
+    public void testScriptUsingMultipleColons() {
+        Assertions.assertEquals("It Works",
+         ScriptStringLookup.INSTANCE.lookup("javascript:true ? \"It Works\" : \"It Does Not Work\" "));
+    }
+
+    @Test
+    public void testScriptMissingColon() {
+        assertThrows(IllegalArgumentException.class, () -> {
+            ScriptStringLookup.INSTANCE.lookup("javascript=\"test\"");
+        });
+    }
+
 }