swift tests: Port to Swift 3

Should remain compatible with Swift 2.2
This commit is contained in:
Nirbheek Chauhan 2016-10-03 12:58:10 +05:30 committed by Jussi Pakkanen
parent 62ec92c8b0
commit efc986ee93
2 changed files with 5 additions and 1 deletions

View File

@ -1 +1 @@
printSomething("String from main") printSomething(text:"String from main")

View File

@ -4,7 +4,11 @@
import Glibc import Glibc
#endif #endif
#if swift(>=3.0)
let fname = CommandLine.arguments[1]
#else
let fname = Process.arguments[1] let fname = Process.arguments[1]
#endif
let code = "public func getGenerated() -> Int {\n return 42\n}\n" let code = "public func getGenerated() -> Int {\n return 42\n}\n"
let f = fopen(fname, "w") let f = fopen(fname, "w")