Skip to content

Commit e6f8dc8

Browse files
authored
Fix tests for swift 42 (#46)
1 parent 9351fdb commit e6f8dc8

8 files changed

Lines changed: 29 additions & 59 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
- LANG=en_US.UTF-8
1010
matrix:
1111
- DESTINATION="OS=12.0,name=iPhone XS" SDK="iphonesimulator12.0" POD_LINT="YES" SWIFT_LINT="YES"
12-
- DESTINATION="OS=11.4,name=iPhone 8" SDK="iphonesimulator12.0" POD_LINT="YES" SWIFT_LINT="YES"
12+
- DESTINATION="OS=11.4,name=iPhone 8" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
1313
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
1414
- DESTINATION="OS=9.3,name=iPhone 6" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
1515
# - DESTINATION="OS=8.4,name=iPhone 5S" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"

Example/McPicker.xcodeproj/project.pbxproj

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@
174174
607FACCD1AFB9204008FA782 /* Frameworks */,
175175
607FACCE1AFB9204008FA782 /* Resources */,
176176
C47D12FBF936BCA4F2FC5DF5 /* [CP] Embed Pods Frameworks */,
177-
973D169A1B9454CE644A8880 /* [CP] Copy Pods Resources */,
178177
7218E36A1F0EA822003423A2 /* ShellScript */,
179178
);
180179
buildRules = (
@@ -195,7 +194,6 @@
195194
607FACE21AFB9204008FA782 /* Frameworks */,
196195
607FACE31AFB9204008FA782 /* Resources */,
197196
48272FBEB2AC4541EBD289D6 /* [CP] Embed Pods Frameworks */,
198-
9DE3F95F620581BF19411B68 /* [CP] Copy Pods Resources */,
199197
);
200198
buildRules = (
201199
);
@@ -214,7 +212,7 @@
214212
isa = PBXProject;
215213
attributes = {
216214
LastSwiftUpdateCheck = 0720;
217-
LastUpgradeCheck = 0900;
215+
LastUpgradeCheck = 1000;
218216
ORGANIZATIONNAME = CocoaPods;
219217
TargetAttributes = {
220218
607FACCF1AFB9204008FA782 = {
@@ -317,36 +315,6 @@
317315
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
318316
showEnvVarsInLog = 0;
319317
};
320-
973D169A1B9454CE644A8880 /* [CP] Copy Pods Resources */ = {
321-
isa = PBXShellScriptBuildPhase;
322-
buildActionMask = 2147483647;
323-
files = (
324-
);
325-
inputPaths = (
326-
);
327-
name = "[CP] Copy Pods Resources";
328-
outputPaths = (
329-
);
330-
runOnlyForDeploymentPostprocessing = 0;
331-
shellPath = /bin/sh;
332-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-McPicker_Example/Pods-McPicker_Example-resources.sh\"\n";
333-
showEnvVarsInLog = 0;
334-
};
335-
9DE3F95F620581BF19411B68 /* [CP] Copy Pods Resources */ = {
336-
isa = PBXShellScriptBuildPhase;
337-
buildActionMask = 2147483647;
338-
files = (
339-
);
340-
inputPaths = (
341-
);
342-
name = "[CP] Copy Pods Resources";
343-
outputPaths = (
344-
);
345-
runOnlyForDeploymentPostprocessing = 0;
346-
shellPath = /bin/sh;
347-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-McPicker_Tests/Pods-McPicker_Tests-resources.sh\"\n";
348-
showEnvVarsInLog = 0;
349-
};
350318
C47D12FBF936BCA4F2FC5DF5 /* [CP] Embed Pods Frameworks */ = {
351319
isa = PBXShellScriptBuildPhase;
352320
buildActionMask = 2147483647;
@@ -446,12 +414,14 @@
446414
CLANG_WARN_BOOL_CONVERSION = YES;
447415
CLANG_WARN_COMMA = YES;
448416
CLANG_WARN_CONSTANT_CONVERSION = YES;
417+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
449418
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
450419
CLANG_WARN_EMPTY_BODY = YES;
451420
CLANG_WARN_ENUM_CONVERSION = YES;
452421
CLANG_WARN_INFINITE_RECURSION = YES;
453422
CLANG_WARN_INT_CONVERSION = YES;
454423
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
424+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
455425
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
456426
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
457427
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -484,6 +454,7 @@
484454
ONLY_ACTIVE_ARCH = YES;
485455
SDKROOT = iphoneos;
486456
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
457+
SWIFT_VERSION = 4.2;
487458
};
488459
name = Debug;
489460
};
@@ -499,12 +470,14 @@
499470
CLANG_WARN_BOOL_CONVERSION = YES;
500471
CLANG_WARN_COMMA = YES;
501472
CLANG_WARN_CONSTANT_CONVERSION = YES;
473+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
502474
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
503475
CLANG_WARN_EMPTY_BODY = YES;
504476
CLANG_WARN_ENUM_CONVERSION = YES;
505477
CLANG_WARN_INFINITE_RECURSION = YES;
506478
CLANG_WARN_INT_CONVERSION = YES;
507479
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
480+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
508481
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
509482
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
510483
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -529,6 +502,7 @@
529502
MTL_ENABLE_DEBUG_INFO = NO;
530503
SDKROOT = iphoneos;
531504
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
505+
SWIFT_VERSION = 4.2;
532506
VALIDATE_PRODUCT = YES;
533507
};
534508
name = Release;
@@ -547,7 +521,7 @@
547521
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
548522
PRODUCT_NAME = "$(TARGET_NAME)";
549523
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
550-
SWIFT_VERSION = 4.0;
524+
SWIFT_VERSION = 4.2;
551525
TARGETED_DEVICE_FAMILY = "1,2";
552526
};
553527
name = Debug;
@@ -566,7 +540,7 @@
566540
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
567541
PRODUCT_NAME = "$(TARGET_NAME)";
568542
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
569-
SWIFT_VERSION = 4.0;
543+
SWIFT_VERSION = 4.2;
570544
TARGETED_DEVICE_FAMILY = "1,2";
571545
};
572546
name = Release;
@@ -585,7 +559,7 @@
585559
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
586560
PRODUCT_NAME = "$(TARGET_NAME)";
587561
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
588-
SWIFT_VERSION = 4.0;
562+
SWIFT_VERSION = 4.2;
589563
};
590564
name = Debug;
591565
};
@@ -599,7 +573,7 @@
599573
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
600574
PRODUCT_NAME = "$(TARGET_NAME)";
601575
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
602-
SWIFT_VERSION = 4.0;
576+
SWIFT_VERSION = 4.2;
603577
};
604578
name = Release;
605579
};

Example/McPicker.xcodeproj/xcshareddata/xcschemes/McPicker-Example.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
language = ""
4443
shouldUseLaunchSchemeArgsEnv = "YES">
4544
<Testables>
4645
<TestableReference
@@ -70,7 +69,6 @@
7069
buildConfiguration = "Debug"
7170
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7271
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73-
language = ""
7472
launchStyle = "0"
7573
useCustomWorkingDirectory = "NO"
7674
ignoresPersistentStateOnLaunch = "NO"

Example/McPicker.xcodeproj/xcshareddata/xcschemes/McPicker_Tests.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -10,7 +10,6 @@
1010
buildConfiguration = "Debug"
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13-
language = ""
1413
shouldUseLaunchSchemeArgsEnv = "YES">
1514
<Testables>
1615
<TestableReference
@@ -31,7 +30,6 @@
3130
buildConfiguration = "Debug"
3231
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3332
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
34-
language = ""
3533
launchStyle = "0"
3634
useCustomWorkingDirectory = "NO"
3735
ignoresPersistentStateOnLaunch = "NO"

Example/McPicker/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2727

2828
var window: UIWindow?
2929

30-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
30+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
3131
// Override point for customization after application launch.
3232
return true
3333
}

Example/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
PODS:
2-
- McPicker (0.5.2)
2+
- McPicker (2.0.0)
33

44
DEPENDENCIES:
55
- McPicker (from `../`)
66

77
EXTERNAL SOURCES:
88
McPicker:
9-
:path: ../
9+
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
McPicker: 05016caf44615afc93617b9effa4f1648f3223d6
12+
McPicker: 184bd2403f48f1b69e8384d2dbcd4fcff4c0df5f
1313

1414
PODFILE CHECKSUM: 7f68cc3d721452977903943f3af774acc3f68ed4
1515

16-
COCOAPODS: 1.3.1
16+
COCOAPODS: 1.5.0

Example/Tests/McPickerBarButtonItemTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class McPickerBarButtonItemTests: XCTestCase {
4040
}
4141

4242
func testInitDone_noTitleCustomStyle() {
43-
let item = McPickerBarButtonItem.done(mcPicker: mcPicker, barButtonSystemItem: UIBarButtonSystemItem.save)
43+
let item = McPickerBarButtonItem.done(mcPicker: mcPicker, barButtonSystemItem: UIBarButtonItem.SystemItem.save)
4444

4545
XCTAssertNil(item.title)
4646
XCTAssertTrue(item.style == .plain)
@@ -68,7 +68,7 @@ class McPickerBarButtonItemTests: XCTestCase {
6868
}
6969

7070
func testInitCancel_noTitleCustomStyle() {
71-
let item = McPickerBarButtonItem.cancel(mcPicker: mcPicker, barButtonSystemItem: UIBarButtonSystemItem.save)
71+
let item = McPickerBarButtonItem.cancel(mcPicker: mcPicker, barButtonSystemItem: UIBarButtonItem.SystemItem.save)
7272

7373
XCTAssertNil(item.title)
7474
XCTAssertTrue(item.style == .plain)

Example/Tests/McPickerTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ class McPickerTests: XCTestCase {
230230

231231
// Then
232232
//
233-
XCTAssertEqual(expectedFont, cancelBarButton.titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as! UIFont)
234-
XCTAssertEqual(expectedFont, doneBarButton.titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as! UIFont)
235-
XCTAssertEqual(expectedFont, cancelBarButton.titleTextAttributes(for: .selected)?[NSAttributedStringKey.font.rawValue] as! UIFont)
236-
XCTAssertEqual(expectedFont, doneBarButton.titleTextAttributes(for: .selected)?[NSAttributedStringKey.font.rawValue] as! UIFont)
233+
XCTAssertEqual(expectedFont, cancelBarButton.titleTextAttributes(for: .normal)?[NSAttributedString.Key.font] as! UIFont)
234+
XCTAssertEqual(expectedFont, doneBarButton.titleTextAttributes(for: .normal)?[NSAttributedString.Key.font] as! UIFont)
235+
XCTAssertEqual(expectedFont, cancelBarButton.titleTextAttributes(for: .selected)?[NSAttributedString.Key.font] as! UIFont)
236+
XCTAssertEqual(expectedFont, doneBarButton.titleTextAttributes(for: .selected)?[NSAttributedString.Key.font] as! UIFont)
237237
}
238238

239239
func testSetToolbarItemsFont_afterToolbarItemsSet() {
@@ -253,10 +253,10 @@ class McPickerTests: XCTestCase {
253253

254254
// Then
255255
//
256-
XCTAssertEqual(expectedFont, cancelButton.titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as! UIFont)
257-
XCTAssertEqual(expectedFont, fireButton.titleTextAttributes(for: .normal)?[NSAttributedStringKey.font.rawValue] as! UIFont)
258-
XCTAssertEqual(expectedFont, cancelButton.titleTextAttributes(for: .selected)?[NSAttributedStringKey.font.rawValue] as! UIFont)
259-
XCTAssertEqual(expectedFont, fireButton.titleTextAttributes(for: .selected)?[NSAttributedStringKey.font.rawValue] as! UIFont)
256+
XCTAssertEqual(expectedFont, cancelButton.titleTextAttributes(for: .normal)?[NSAttributedString.Key.font] as! UIFont)
257+
XCTAssertEqual(expectedFont, fireButton.titleTextAttributes(for: .normal)?[NSAttributedString.Key.font] as! UIFont)
258+
XCTAssertEqual(expectedFont, cancelButton.titleTextAttributes(for: .selected)?[NSAttributedString.Key.font] as! UIFont)
259+
XCTAssertEqual(expectedFont, fireButton.titleTextAttributes(for: .selected)?[NSAttributedString.Key.font] as! UIFont)
260260
}
261261

262262
func testSetPickerBackgroundColor() {

0 commit comments

Comments
 (0)