Skip to content

Commit 4d88ca7

Browse files
authored
update unicode test dat files for runtime language levels (#5066)
1 parent 3c80842 commit 4d88ca7

File tree

5 files changed

+31
-18
lines changed

5 files changed

+31
-18
lines changed

tests/dat/actions/unicode.tests/python-2.txt renamed to tests/dat/actions/unicode.tests/go-1.15.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
"""Python 2 Unicode test.
21
/*
32
* Licensed to the Apache Software Foundation (ASF) under one or more
43
* contributor license agreements. See the NOTICE file distributed with
@@ -15,10 +14,16 @@
1514
* See the License for the specific language governing permissions and
1615
* limitations under the License.
1716
*/
18-
"""
1917

20-
def main(args):
21-
sep = args['delimiter']
22-
str = sep + " ☃ ".decode('utf-8') + sep
23-
print(str.encode('utf-8'))
24-
return {"winter": str}
18+
package main
19+
20+
import "fmt"
21+
22+
func Main(args map[string]interface{}) map[string]interface{} {
23+
delimiter := args["delimiter"].(string)
24+
str := delimiter + " ☃ " + delimiter
25+
fmt.Println(str)
26+
res := make(map[string]interface{})
27+
res["winter"] = str
28+
return res
29+
}

tests/dat/actions/unicode.tests/python.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Python 2 Unicode test.
1+
"""Python 3 Unicode test.
22
/*
33
* Licensed to the Apache Software Foundation (ASF) under one or more
44
* contributor license agreements. See the NOTICE file distributed with
@@ -19,6 +19,6 @@
1919

2020
def main(args):
2121
sep = args['delimiter']
22-
str = sep + " ☃ ".decode('utf-8') + sep
23-
print(str.encode('utf-8'))
22+
str = sep + " ☃ " + sep
23+
print(str)
2424
return {"winter": str}

tests/dat/actions/unicode.tests/nodejs-6.txt renamed to tests/dat/actions/unicode.tests/swift-5.1.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
* limitations under the License.
1616
*/
1717

18-
function main(args) {
19-
var str = args.delimiter + " ☃ " + args.delimiter;
20-
console.log(str);
21-
return { "winter": str };
18+
func main(args: [String:Any]) -> [String:Any] {
19+
if let str = args["delimiter"] as? String {
20+
let msg = "\(str) ☃ \(str)"
21+
print(msg)
22+
return [ "winter" : msg ]
23+
} else {
24+
return [ "error" : "no delimiter" ]
25+
}
2226
}

tests/dat/actions/unicode.tests/nodejs-8.txt renamed to tests/dat/actions/unicode.tests/swift-5.3.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
* limitations under the License.
1616
*/
1717

18-
function main(args) {
19-
var str = args.delimiter + " ☃ " + args.delimiter;
20-
console.log(str);
21-
return { "winter": str };
18+
func main(args: [String:Any]) -> [String:Any] {
19+
if let str = args["delimiter"] as? String {
20+
let msg = "\(str) ☃ \(str)"
21+
print(msg)
22+
return [ "winter" : msg ]
23+
} else {
24+
return [ "error" : "no delimiter" ]
25+
}
2226
}

0 commit comments

Comments
 (0)