Skip to content

Commit

Permalink
update unicode test dat files for runtime language levels
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrove-oss committed Feb 13, 2021
1 parent 3c80842 commit 8a2f018
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"""Python 2 Unicode test.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand All @@ -15,10 +14,16 @@
* 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}
package main

import "fmt"

func Main(args map[string]interface{}) map[string]interface{} {
delimiter := args["delimiter"].(string)
str := delimiter + " ☃ " + delimiter
fmt.Println(str)
res := make(map[string]interface{})
res["winter"] = str
return res
}
6 changes: 3 additions & 3 deletions tests/dat/actions/unicode.tests/python.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
}

0 comments on commit 8a2f018

Please sign in to comment.