Skip to content

Commit

Permalink
Updating Swift tests to remove outdated tests and use more current ca…
Browse files Browse the repository at this point in the history
…lls.
  • Loading branch information
Drew Maxwell committed Sep 16, 2022
1 parent 453fd22 commit 7825221
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 24 deletions.
10 changes: 0 additions & 10 deletions test/Interpreter/SDK/FoundationDiagnostics.swift

This file was deleted.

4 changes: 3 additions & 1 deletion test/Interpreter/SDK/Foundation_NSRect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
// iOS doesn't have NSRect. iOS and OS X CGRect is tested elsewhere.
// REQUIRES: OS=macosx

import Foundation
import Coreimage

_ = JSONDecoder()

func printRect(_ r: NSRect) {
// FIXME: Constraint checker takes too long to typecheck this as an
Expand Down
10 changes: 0 additions & 10 deletions test/Interpreter/SDK/Quartz_without_Foundation.swift

This file was deleted.

4 changes: 4 additions & 0 deletions test/Interpreter/SDK/objc_implicit_inner_pointer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
// REQUIRES: executable_test
// REQUIRES: objc_interop

import Foundation

_ = JSONDecoder()

do {
// The lifetime of Foo() currently gets extended using autorelease.
autoreleasepool {
Expand Down
2 changes: 2 additions & 0 deletions test/Interpreter/SDK/objc_inner_pointer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// REQUIRES: objc_interop

import Foundation

_ = JSONDecoder()

class Canary: NSObject {
deinit {
Expand Down
2 changes: 2 additions & 0 deletions test/Interpreter/SDK/objc_unowned.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import Foundation

_ = JSONDecoder()

let x = NSObject()
unowned let y = x

Expand Down
7 changes: 4 additions & 3 deletions test/stdlib/NSStringAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ NSStringAPIs.test("init(contentsOf:usedEncoding:error:)") {
}

NSStringAPIs.test("init(cString_:encoding:)") {
expectEqual("foo, a basmati bar!",
String(cString:
"foo, a basmati bar!", encoding: String.defaultCStringEncoding))
"foo, a basmati bar!".withCString {
expectEqual("foo, a basmati bar!",
String(cString: $0, encoding: String.defaultCStringEncoding))
}
}

NSStringAPIs.test("init(utf8String:)") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func run(on object: PFXObject) async throws {

@main struct Main {
static func main() async throws {
_ = JSONDecoder()
let object = PFXObject()
try await run(on: object)
}
Expand Down

0 comments on commit 7825221

Please sign in to comment.