File tree Expand file tree Collapse file tree 5 files changed +31
-18
lines changed
tests/dat/actions/unicode.tests Expand file tree Collapse file tree 5 files changed +31
-18
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1
- """Python 2 Unicode test.
2
1
/*
3
2
* Licensed to the Apache Software Foundation (ASF) under one or more
4
3
* contributor license agreements. See the NOTICE file distributed with
15
14
* See the License for the specific language governing permissions and
16
15
* limitations under the License.
17
16
*/
18
- """
19
17
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
+ }
Original file line number Diff line number Diff line change 1
- """Python 2 Unicode test.
1
+ """Python 3 Unicode test.
2
2
/*
3
3
* Licensed to the Apache Software Foundation (ASF) under one or more
4
4
* contributor license agreements. See the NOTICE file distributed with
19
19
20
20
def main(args):
21
21
sep = args['delimiter']
22
- str = sep + " ☃ ".decode('utf-8') + sep
23
- print(str.encode('utf-8') )
22
+ str = sep + " ☃ " + sep
23
+ print(str)
24
24
return {"winter": str}
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
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
+ }
22
26
}
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
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
+ }
22
26
}
You can’t perform that action at this time.
0 commit comments