This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d88ca7  update unicode test dat files for runtime language levels 
(#5066)
4d88ca7 is described below

commit 4d88ca782795b995591b4f3c0e44d61b76005232
Author: David Grove <[email protected]>
AuthorDate: Mon Feb 15 20:23:33 2021 -0500

    update unicode test dat files for runtime language levels (#5066)
---
 .../unicode.tests/{go-1.11.txt => go-1.13.txt}     |  0
 .../unicode.tests/{go-1.11.txt => go-1.15.txt}     |  0
 tests/dat/actions/unicode.tests/python-2.txt       | 24 ----------------------
 tests/dat/actions/unicode.tests/python.txt         |  6 +++---
 .../unicode.tests/{nodejs-6.txt => swift-5.1.txt}  | 12 +++++++----
 .../unicode.tests/{nodejs-8.txt => swift-5.3.txt}  | 12 +++++++----
 6 files changed, 19 insertions(+), 35 deletions(-)

diff --git a/tests/dat/actions/unicode.tests/go-1.11.txt 
b/tests/dat/actions/unicode.tests/go-1.13.txt
similarity index 100%
copy from tests/dat/actions/unicode.tests/go-1.11.txt
copy to tests/dat/actions/unicode.tests/go-1.13.txt
diff --git a/tests/dat/actions/unicode.tests/go-1.11.txt 
b/tests/dat/actions/unicode.tests/go-1.15.txt
similarity index 100%
rename from tests/dat/actions/unicode.tests/go-1.11.txt
rename to tests/dat/actions/unicode.tests/go-1.15.txt
diff --git a/tests/dat/actions/unicode.tests/python-2.txt 
b/tests/dat/actions/unicode.tests/python-2.txt
deleted file mode 100644
index 8ef252f..0000000
--- a/tests/dat/actions/unicode.tests/python-2.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-"""Python 2 Unicode test.
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-"""
-
-def main(args):
-    sep = args['delimiter']
-    str = sep + " ☃ ".decode('utf-8') + sep
-    print(str.encode('utf-8'))
-    return {"winter": str}
diff --git a/tests/dat/actions/unicode.tests/python.txt 
b/tests/dat/actions/unicode.tests/python.txt
index 8ef252f..d416171 100644
--- a/tests/dat/actions/unicode.tests/python.txt
+++ b/tests/dat/actions/unicode.tests/python.txt
@@ -1,4 +1,4 @@
-"""Python 2 Unicode test.
+"""Python 3 Unicode test.
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -19,6 +19,6 @@
 
 def main(args):
     sep = args['delimiter']
-    str = sep + " ☃ ".decode('utf-8') + sep
-    print(str.encode('utf-8'))
+    str = sep + " ☃ " + sep
+    print(str)
     return {"winter": str}
diff --git a/tests/dat/actions/unicode.tests/nodejs-6.txt 
b/tests/dat/actions/unicode.tests/swift-5.1.txt
similarity index 76%
rename from tests/dat/actions/unicode.tests/nodejs-6.txt
rename to tests/dat/actions/unicode.tests/swift-5.1.txt
index a14319c..aff9c50 100644
--- a/tests/dat/actions/unicode.tests/nodejs-6.txt
+++ b/tests/dat/actions/unicode.tests/swift-5.1.txt
@@ -15,8 +15,12 @@
  * limitations under the License.
  */
 
-function main(args) {
-    var str = args.delimiter + " ☃ " + args.delimiter;
-    console.log(str);
-    return { "winter": str };
+func main(args: [String:Any]) -> [String:Any] {
+    if let str = args["delimiter"] as? String {
+        let msg = "\(str) ☃ \(str)"
+        print(msg)
+        return [ "winter" : msg ]
+    } else {
+        return [ "error" : "no delimiter" ]
+    }
 }
diff --git a/tests/dat/actions/unicode.tests/nodejs-8.txt 
b/tests/dat/actions/unicode.tests/swift-5.3.txt
similarity index 76%
rename from tests/dat/actions/unicode.tests/nodejs-8.txt
rename to tests/dat/actions/unicode.tests/swift-5.3.txt
index a14319c..aff9c50 100644
--- a/tests/dat/actions/unicode.tests/nodejs-8.txt
+++ b/tests/dat/actions/unicode.tests/swift-5.3.txt
@@ -15,8 +15,12 @@
  * limitations under the License.
  */
 
-function main(args) {
-    var str = args.delimiter + " ☃ " + args.delimiter;
-    console.log(str);
-    return { "winter": str };
+func main(args: [String:Any]) -> [String:Any] {
+    if let str = args["delimiter"] as? String {
+        let msg = "\(str) ☃ \(str)"
+        print(msg)
+        return [ "winter" : msg ]
+    } else {
+        return [ "error" : "no delimiter" ]
+    }
 }

Reply via email to