├── .gitignore
├── .slather.yml
├── .travis.yml
├── ASMapLauncher.podspec
├── ASMapLauncher.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcshareddata
│ └── xcschemes
│ ├── ASMapLauncher.xcscheme
│ ├── ASMapLauncherFramework.xcscheme
│ └── ASMapLauncherTests.xcscheme
├── ASMapLauncher.xcworkspace
├── contents.xcworkspacedata
└── xcshareddata
│ └── IDEWorkspaceChecks.plist
├── ASMapLauncher
├── AppDelegate.swift
├── Base.lproj
│ ├── LaunchScreen.xib
│ └── Main.storyboard
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Source
│ ├── ASMapLauncher.swift
│ └── MapPoint.swift
└── ViewController.swift
├── ASMapLauncherFramework
├── ASMapLauncherFramework.h
└── Info.plist
├── ASMapLauncherTests
├── ASMapLauncherTests.swift
└── Info.plist
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── Podfile
├── Podfile.lock
├── Pods
├── Manifest.lock
├── Nimble
│ ├── Carthage
│ │ └── Checkouts
│ │ │ └── CwlPreconditionTesting
│ │ │ ├── Dependencies
│ │ │ └── CwlCatchException
│ │ │ │ └── Sources
│ │ │ │ ├── CwlCatchException
│ │ │ │ └── CwlCatchException.swift
│ │ │ │ └── CwlCatchExceptionSupport
│ │ │ │ ├── CwlCatchException.m
│ │ │ │ └── include
│ │ │ │ └── CwlCatchException.h
│ │ │ └── Sources
│ │ │ ├── CwlMachBadInstructionHandler
│ │ │ ├── CwlMachBadInstructionHandler.m
│ │ │ ├── include
│ │ │ │ └── CwlMachBadInstructionHandler.h
│ │ │ ├── mach_excServer.c
│ │ │ └── mach_excServer.h
│ │ │ └── CwlPreconditionTesting
│ │ │ ├── CwlBadInstructionException.swift
│ │ │ ├── CwlCatchBadInstruction.swift
│ │ │ ├── CwlDarwinDefinitions.swift
│ │ │ └── include
│ │ │ └── CwlPreconditionTesting.h
│ ├── LICENSE
│ ├── README.md
│ └── Sources
│ │ ├── Nimble
│ │ ├── Adapters
│ │ │ ├── AdapterProtocols.swift
│ │ │ ├── AssertionDispatcher.swift
│ │ │ ├── AssertionRecorder.swift
│ │ │ ├── NMBExpectation.swift
│ │ │ ├── NMBObjCMatcher.swift
│ │ │ ├── NimbleEnvironment.swift
│ │ │ └── NimbleXCTestHandler.swift
│ │ ├── DSL+Wait.swift
│ │ ├── DSL.swift
│ │ ├── Expectation.swift
│ │ ├── ExpectationMessage.swift
│ │ ├── Expression.swift
│ │ ├── FailureMessage.swift
│ │ ├── Matchers
│ │ │ ├── AllPass.swift
│ │ │ ├── Async.swift
│ │ │ ├── BeAKindOf.swift
│ │ │ ├── BeAnInstanceOf.swift
│ │ │ ├── BeCloseTo.swift
│ │ │ ├── BeEmpty.swift
│ │ │ ├── BeGreaterThan.swift
│ │ │ ├── BeGreaterThanOrEqualTo.swift
│ │ │ ├── BeIdenticalTo.swift
│ │ │ ├── BeLessThan.swift
│ │ │ ├── BeLessThanOrEqual.swift
│ │ │ ├── BeLogical.swift
│ │ │ ├── BeNil.swift
│ │ │ ├── BeVoid.swift
│ │ │ ├── BeginWith.swift
│ │ │ ├── Contain.swift
│ │ │ ├── ContainElementSatisfying.swift
│ │ │ ├── ElementsEqual.swift
│ │ │ ├── EndWith.swift
│ │ │ ├── Equal.swift
│ │ │ ├── HaveCount.swift
│ │ │ ├── Match.swift
│ │ │ ├── MatchError.swift
│ │ │ ├── MatcherFunc.swift
│ │ │ ├── MatcherProtocols.swift
│ │ │ ├── PostNotification.swift
│ │ │ ├── Predicate.swift
│ │ │ ├── RaisesException.swift
│ │ │ ├── SatisfyAllOf.swift
│ │ │ ├── SatisfyAnyOf.swift
│ │ │ ├── ThrowAssertion.swift
│ │ │ ├── ThrowError.swift
│ │ │ └── ToSucceed.swift
│ │ ├── Nimble.h
│ │ └── Utils
│ │ │ ├── Await.swift
│ │ │ ├── Errors.swift
│ │ │ ├── Functional.swift
│ │ │ ├── SourceLocation.swift
│ │ │ └── Stringers.swift
│ │ └── NimbleObjectiveC
│ │ ├── DSL.h
│ │ ├── DSL.m
│ │ ├── NMBExceptionCapture.h
│ │ ├── NMBExceptionCapture.m
│ │ ├── NMBStringify.h
│ │ ├── NMBStringify.m
│ │ └── XCTestObservationCenter+Register.m
├── Pods.xcodeproj
│ └── project.pbxproj
├── Quick
│ ├── LICENSE
│ ├── README.md
│ └── Sources
│ │ ├── Quick
│ │ ├── Behavior.swift
│ │ ├── Callsite.swift
│ │ ├── Configuration
│ │ │ ├── Configuration.swift
│ │ │ └── QuickConfiguration.swift
│ │ ├── DSL
│ │ │ ├── DSL.swift
│ │ │ └── World+DSL.swift
│ │ ├── ErrorUtility.swift
│ │ ├── Example.swift
│ │ ├── ExampleGroup.swift
│ │ ├── ExampleMetadata.swift
│ │ ├── Filter.swift
│ │ ├── Hooks
│ │ │ ├── Closures.swift
│ │ │ ├── ExampleHooks.swift
│ │ │ ├── HooksPhase.swift
│ │ │ └── SuiteHooks.swift
│ │ ├── NSBundle+CurrentTestBundle.swift
│ │ ├── QuickSelectedTestSuiteBuilder.swift
│ │ ├── QuickTestObservation.swift
│ │ ├── QuickTestSuite.swift
│ │ ├── String+C99ExtendedIdentifier.swift
│ │ ├── URL+FileName.swift
│ │ └── World.swift
│ │ ├── QuickObjCRuntime
│ │ ├── QuickSpecBase.m
│ │ └── include
│ │ │ └── QuickSpecBase.h
│ │ └── QuickObjectiveC
│ │ ├── Configuration
│ │ ├── QuickConfiguration.h
│ │ └── QuickConfiguration.m
│ │ ├── DSL
│ │ ├── QCKDSL.h
│ │ └── QCKDSL.m
│ │ ├── Quick.h
│ │ ├── QuickSpec.h
│ │ ├── QuickSpec.m
│ │ └── XCTestSuite+QuickTestSuiteBuilder.m
└── Target Support Files
│ ├── Nimble
│ ├── Info.plist
│ ├── Nimble-Info.plist
│ ├── Nimble-dummy.m
│ ├── Nimble-prefix.pch
│ ├── Nimble-umbrella.h
│ ├── Nimble.debug.xcconfig
│ ├── Nimble.modulemap
│ ├── Nimble.release.xcconfig
│ └── Nimble.xcconfig
│ ├── Pods-ASMapLauncher
│ ├── Info.plist
│ ├── Pods-ASMapLauncher-Info.plist
│ ├── Pods-ASMapLauncher-acknowledgements.markdown
│ ├── Pods-ASMapLauncher-acknowledgements.plist
│ ├── Pods-ASMapLauncher-dummy.m
│ ├── Pods-ASMapLauncher-frameworks.sh
│ ├── Pods-ASMapLauncher-resources.sh
│ ├── Pods-ASMapLauncher-umbrella.h
│ ├── Pods-ASMapLauncher.debug.xcconfig
│ ├── Pods-ASMapLauncher.modulemap
│ └── Pods-ASMapLauncher.release.xcconfig
│ ├── Pods-ASMapLauncherTests
│ ├── Info.plist
│ ├── Pods-ASMapLauncherTests-Info.plist
│ ├── Pods-ASMapLauncherTests-acknowledgements.markdown
│ ├── Pods-ASMapLauncherTests-acknowledgements.plist
│ ├── Pods-ASMapLauncherTests-dummy.m
│ ├── Pods-ASMapLauncherTests-frameworks.sh
│ ├── Pods-ASMapLauncherTests-resources.sh
│ ├── Pods-ASMapLauncherTests-umbrella.h
│ ├── Pods-ASMapLauncherTests.debug.xcconfig
│ ├── Pods-ASMapLauncherTests.modulemap
│ └── Pods-ASMapLauncherTests.release.xcconfig
│ └── Quick
│ ├── Info.plist
│ ├── Quick-Info.plist
│ ├── Quick-dummy.m
│ ├── Quick-prefix.pch
│ ├── Quick-umbrella.h
│ ├── Quick.debug.xcconfig
│ ├── Quick.modulemap
│ ├── Quick.release.xcconfig
│ └── Quick.xcconfig
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | # Pods/
27 |
28 | # Carthage
29 | #
30 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
31 | # Carthage/Checkouts
32 |
33 | Carthage/Build
34 |
--------------------------------------------------------------------------------
/.slather.yml:
--------------------------------------------------------------------------------
1 | ci_service: travis_ci
2 | coverage_service: coveralls
3 | workspace: ASMapLauncher.xcodeworkspace
4 | xcodeproj: ASMapLauncher.xcodeproj
5 | scheme: ASMapLauncher
6 | source_directory: ASMapLauncher/Source/
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | osx_image: xcode12.4
3 |
4 | env:
5 | global:
6 | - LC_CTYPE=en_US.UTF-8
7 | - LANG=en_US.UTF-8
8 | - WORKSPACE=ASMapLauncher.xcworkspace
9 | - SCHEME=ASMapLauncher
10 | - SDK=iphonesimulator14.4
11 | - RUN_TESTS="YES"
12 | - POD_LINT="NO"
13 | matrix:
14 | - DESTINATION="OS=14.4,name=iPhone 11 Pro"
15 | - DESTINATION="OS=13.6,name=iPhone 11"
16 | - DESTINATION="OS=12.1,name=iPhone X"
17 | - DESTINATION="OS=11.4,name=iPhone 8"
18 |
19 | before_install:
20 | - rm -rf /Users/travis/Library/Developer/Xcode/DerivedData/ASMapLauncher-*/
21 | - rvm use $RVM_RUBY_VERSION
22 |
23 | install:
24 | - bundle install
25 |
26 | script:
27 | - set -o pipefail
28 | - xcodebuild -version
29 | - xcodebuild -showsdks
30 |
31 | # Build in Debug and Run Tests if specified
32 | - if [ $RUN_TESTS == "YES" ]; then
33 | travis_retry xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
34 | else
35 | xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
36 | fi
37 |
38 | after_success: slather
39 |
--------------------------------------------------------------------------------
/ASMapLauncher.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 |
3 | s.name = 'ASMapLauncher'
4 | s.version = '1.0.8'
5 | s.summary = 'ASMapLauncher is a library for iOS written in Swift that helps navigation with various mapping applications'
6 | s.homepage = 'https://github.com/abdullahselek/ASMapLauncher'
7 | s.license = {
8 | :type => 'MIT',
9 | :file => 'LICENSE'
10 | }
11 | s.author = {
12 | 'Abdullah Selek' => 'abdullahselek@yahoo.com'
13 | }
14 | s.source = {
15 | :git => 'https://github.com/abdullahselek/ASMapLauncher.git',
16 | :tag => s.version.to_s
17 | }
18 | s.ios.deployment_target = '11.0'
19 | s.source_files = 'ASMapLauncher/Source/*.swift'
20 | s.requires_arc = true
21 | s.swift_version = '5.0'
22 |
23 | end
24 |
--------------------------------------------------------------------------------
/ASMapLauncher.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ASMapLauncher.xcodeproj/xcshareddata/xcschemes/ASMapLauncher.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
45 |
46 |
52 |
53 |
54 |
55 |
57 |
63 |
64 |
65 |
66 |
67 |
77 |
79 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/ASMapLauncher.xcodeproj/xcshareddata/xcschemes/ASMapLauncherFramework.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
52 |
53 |
59 |
60 |
66 |
67 |
68 |
69 |
71 |
72 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/ASMapLauncher.xcodeproj/xcshareddata/xcschemes/ASMapLauncherTests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
14 |
15 |
17 |
23 |
24 |
25 |
26 |
27 |
37 |
38 |
44 |
45 |
47 |
48 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/ASMapLauncher.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ASMapLauncher.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ASMapLauncher/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // ASMapLauncher
4 | //
5 | // Created by Abdullah Selek on 06/06/15.
6 | // Copyright (c) 2015 Abdullah Selek. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/ASMapLauncher/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ASMapLauncher/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/ASMapLauncher/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/ASMapLauncher/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSLocationWhenInUseUsageDescription
26 | For getting current location give me your permission
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | LSApplicationQueriesSchemes
42 |
43 | comgooglemaps
44 | yandexnavi
45 | citymapper
46 | navigon
47 | transit
48 | waze
49 | here-route
50 | moovit
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/ASMapLauncher/Source/MapPoint.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MapPoint.swift
3 | // ASMapLauncher
4 | //
5 | // Copyright (c) 2015 Abdullah Selek. All rights reserved.
6 | //
7 | // The MIT License (MIT)
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 |
27 | import CoreLocation
28 |
29 | /**
30 | Point class used for deep linking
31 | */
32 | open class MapPoint {
33 |
34 | /**
35 | Location value for navigation
36 | */
37 | internal var location: CLLocation!
38 |
39 | /**
40 | Place name
41 | */
42 | internal var name: String!
43 |
44 | /**
45 | Place address
46 | */
47 | internal var address: String!
48 |
49 | /**
50 | Initialize point object with given parameters
51 | - parameter location: Location belongs to place
52 | - parameter name: Name belongs to place
53 | - parameter address: Address belongs to place
54 | */
55 | public init(location: CLLocation, name: String, address: String) {
56 | self.location = location
57 | self.name = name
58 | self.address = address
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/ASMapLauncherFramework/ASMapLauncherFramework.h:
--------------------------------------------------------------------------------
1 | //
2 | // ASMapLauncherFramework.h
3 | // ASMapLauncherFramework
4 | //
5 | // Created by Abdullah Selek on 06/12/2016.
6 | // Copyright © 2016 Abdullah Selek. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for ASMapLauncherFramework.
12 | FOUNDATION_EXPORT double ASMapLauncherFrameworkVersionNumber;
13 |
14 | //! Project version string for ASMapLauncherFramework.
15 | FOUNDATION_EXPORT const unsigned char ASMapLauncherFrameworkVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ASMapLauncherFramework/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ASMapLauncherTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gem 'slather'
4 | gem 'xcpretty'
5 | gem 'nokogiri'
6 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (3.0.2)
5 | activesupport (4.2.11.3)
6 | i18n (~> 0.7)
7 | minitest (~> 5.1)
8 | thread_safe (~> 0.3, >= 0.3.4)
9 | tzinfo (~> 1.1)
10 | atomos (0.1.3)
11 | claide (1.0.3)
12 | clamp (1.3.1)
13 | colored2 (3.1.2)
14 | concurrent-ruby (1.1.6)
15 | i18n (0.9.5)
16 | concurrent-ruby (~> 1.0)
17 | mini_portile2 (2.8.1)
18 | minitest (5.14.1)
19 | nanaimo (0.2.6)
20 | nokogiri (1.14.3)
21 | mini_portile2 (~> 2.8.0)
22 | racc (~> 1.4)
23 | racc (1.6.2)
24 | rouge (2.0.7)
25 | slather (2.4.9)
26 | CFPropertyList (>= 2.2, < 4)
27 | activesupport (>= 4.0.2, < 5)
28 | clamp (~> 1.3)
29 | nokogiri (~> 1.8)
30 | xcodeproj (~> 1.7)
31 | thread_safe (0.3.6)
32 | tzinfo (1.2.10)
33 | thread_safe (~> 0.1)
34 | xcodeproj (1.16.0)
35 | CFPropertyList (>= 2.3.3, < 4.0)
36 | atomos (~> 0.1.3)
37 | claide (>= 1.0.2, < 2.0)
38 | colored2 (~> 3.1)
39 | nanaimo (~> 0.2.6)
40 | xcpretty (0.3.0)
41 | rouge (~> 2.0.7)
42 |
43 | PLATFORMS
44 | ruby
45 |
46 | DEPENDENCIES
47 | nokogiri
48 | slather
49 | xcpretty
50 |
51 | BUNDLED WITH
52 | 1.17.2
53 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Abdullah Selek
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '9.0'
2 |
3 | def testing_pods
4 | pod 'Quick'
5 | pod 'Nimble', :inhibit_warnings => true
6 | end
7 |
8 | target 'ASMapLauncher' do
9 | use_frameworks!
10 |
11 | target 'ASMapLauncherTests' do
12 | inherit! :search_paths
13 | testing_pods
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Nimble (8.1.1)
3 | - Quick (3.0.0)
4 |
5 | DEPENDENCIES:
6 | - Nimble
7 | - Quick
8 |
9 | SPEC REPOS:
10 | trunk:
11 | - Nimble
12 | - Quick
13 |
14 | SPEC CHECKSUMS:
15 | Nimble: 5f8a2fb6fa343a7242dfdd9d42f7267419d464b2
16 | Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2
17 |
18 | PODFILE CHECKSUM: c20ce07d65ca1b29a660978d7acc5d5f31202a8a
19 |
20 | COCOAPODS: 1.9.3
21 |
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Nimble (8.1.1)
3 | - Quick (3.0.0)
4 |
5 | DEPENDENCIES:
6 | - Nimble
7 | - Quick
8 |
9 | SPEC REPOS:
10 | trunk:
11 | - Nimble
12 | - Quick
13 |
14 | SPEC CHECKSUMS:
15 | Nimble: 5f8a2fb6fa343a7242dfdd9d42f7267419d464b2
16 | Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2
17 |
18 | PODFILE CHECKSUM: c20ce07d65ca1b29a660978d7acc5d5f31202a8a
19 |
20 | COCOAPODS: 1.9.3
21 |
--------------------------------------------------------------------------------
/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Dependencies/CwlCatchException/Sources/CwlCatchException/CwlCatchException.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CwlCatchException.swift
3 | // CwlAssertionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved.
7 | //
8 | // Permission to use, copy, modify, and/or distribute this software for any
9 | // purpose with or without fee is hereby granted, provided that the above
10 | // copyright notice and this permission notice appear in all copies.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 | //
20 |
21 | import Foundation
22 |
23 | #if canImport(NimbleCwlCatchExceptionSupport)
24 | import NimbleCwlCatchExceptionSupport
25 | #endif
26 |
27 | private func catchReturnTypeConverter(_ type: T.Type, block: @escaping () -> Void) -> T? {
28 | return catchExceptionOfKind(type, block) as? T
29 | }
30 |
31 | extension NSException {
32 | public static func catchException(in block: @escaping () -> Void) -> Self? {
33 | return catchReturnTypeConverter(self, block: block)
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Dependencies/CwlCatchException/Sources/CwlCatchExceptionSupport/CwlCatchException.m:
--------------------------------------------------------------------------------
1 | //
2 | // CwlCatchException.m
3 | // CwlAssertionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved.
7 | //
8 | // Permission to use, copy, modify, and/or distribute this software for any
9 | // purpose with or without fee is hereby granted, provided that the above
10 | // copyright notice and this permission notice appear in all copies.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 | //
20 |
21 | #import "CwlCatchException.h"
22 |
23 | NSException* __nullable catchExceptionOfKind(Class __nonnull type, void (^ __nonnull inBlock)(void)) {
24 | @try {
25 | inBlock();
26 | } @catch (NSException *exception) {
27 | if ([exception isKindOfClass:type]) {
28 | return exception;
29 | } else {
30 | @throw;
31 | }
32 | }
33 | return nil;
34 | }
35 |
--------------------------------------------------------------------------------
/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Dependencies/CwlCatchException/Sources/CwlCatchExceptionSupport/include/CwlCatchException.h:
--------------------------------------------------------------------------------
1 | //
2 | // CwlCatchException.h
3 | // CwlCatchException
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved.
7 | //
8 | // Permission to use, copy, modify, and/or distribute this software for any
9 | // purpose with or without fee is hereby granted, provided that the above
10 | // copyright notice and this permission notice appear in all copies.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 | //
20 |
21 | #import
22 |
23 | //! Project version number for CwlCatchException.
24 | FOUNDATION_EXPORT double CwlCatchExceptionVersionNumber;
25 |
26 | //! Project version string for CwlCatchException.
27 | FOUNDATION_EXPORT const unsigned char CwlCatchExceptionVersionString[];
28 |
29 | NSException* __nullable catchExceptionOfKind(Class __nonnull type, void (^ __nonnull inBlock)(void));
30 |
--------------------------------------------------------------------------------
/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/CwlMachBadInstructionHandler.m:
--------------------------------------------------------------------------------
1 | //
2 | // CwlMachBadExceptionHandler.m
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved.
7 | //
8 | // Permission to use, copy, modify, and/or distribute this software for any
9 | // purpose with or without fee is hereby granted, provided that the above
10 | // copyright notice and this permission notice appear in all copies.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 | //
20 |
21 | #ifdef __APPLE__
22 | #import "TargetConditionals.h"
23 | #if TARGET_OS_OSX || TARGET_OS_IOS
24 |
25 | #import "mach_excServer.h"
26 | #import "CwlMachBadInstructionHandler.h"
27 |
28 | @protocol BadInstructionReply
29 | +(NSNumber *)receiveReply:(NSValue *)value;
30 | @end
31 |
32 | /// A basic function that receives callbacks from mach_exc_server and relays them to the Swift implemented BadInstructionException.catch_mach_exception_raise_state.
33 | kern_return_t catch_mach_exception_raise_state(mach_port_t exception_port, exception_type_t exception, const mach_exception_data_t code, mach_msg_type_number_t codeCnt, int *flavor, const thread_state_t old_state, mach_msg_type_number_t old_stateCnt, thread_state_t new_state, mach_msg_type_number_t *new_stateCnt) {
34 | bad_instruction_exception_reply_t reply = { exception_port, exception, code, codeCnt, flavor, old_state, old_stateCnt, new_state, new_stateCnt };
35 | Class badInstructionClass = NSClassFromString(@"BadInstructionException");
36 | NSValue *value = [NSValue valueWithBytes: &reply objCType: @encode(bad_instruction_exception_reply_t)];
37 | return [[badInstructionClass performSelector: @selector(receiveReply:) withObject: value] intValue];
38 | }
39 |
40 | // The mach port should be configured so that this function is never used.
41 | kern_return_t catch_mach_exception_raise(mach_port_t exception_port, mach_port_t thread, mach_port_t task, exception_type_t exception, mach_exception_data_t code, mach_msg_type_number_t codeCnt) {
42 | assert(false);
43 | return KERN_FAILURE;
44 | }
45 |
46 | // The mach port should be configured so that this function is never used.
47 | kern_return_t catch_mach_exception_raise_state_identity(mach_port_t exception_port, mach_port_t thread, mach_port_t task, exception_type_t exception, mach_exception_data_t code, mach_msg_type_number_t codeCnt, int *flavor, thread_state_t old_state, mach_msg_type_number_t old_stateCnt, thread_state_t new_state, mach_msg_type_number_t *new_stateCnt) {
48 | assert(false);
49 | return KERN_FAILURE;
50 | }
51 |
52 | #endif /* TARGET_OS_OSX || TARGET_OS_IOS */
53 | #endif /* __APPLE__ */
54 |
--------------------------------------------------------------------------------
/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/include/CwlMachBadInstructionHandler.h:
--------------------------------------------------------------------------------
1 | //
2 | // CwlMachBadInstructionHandler.h
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved.
7 | //
8 | // Permission to use, copy, modify, and/or distribute this software for any
9 | // purpose with or without fee is hereby granted, provided that the above
10 | // copyright notice and this permission notice appear in all copies.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 | //
20 |
21 | #import
22 |
23 | #if TARGET_OS_OSX || TARGET_OS_IOS
24 |
25 | #import
26 |
27 | extern bool _swift_disableExclusivityChecking;
28 | extern bool _swift_reportFatalErrorsToDebugger;
29 |
30 | NS_ASSUME_NONNULL_BEGIN
31 |
32 | extern boolean_t mach_exc_server(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
33 |
34 | // The request_mach_exception_raise_t struct is passed to mach_msg which assumes its exact layout. To avoid problems with different layouts, we keep the definition in C rather than Swift.
35 | typedef struct
36 | {
37 | mach_msg_header_t Head;
38 | /* start of the kernel processed data */
39 | mach_msg_body_t msgh_body;
40 | mach_msg_port_descriptor_t thread;
41 | mach_msg_port_descriptor_t task;
42 | /* end of the kernel processed data */
43 | NDR_record_t NDR;
44 | exception_type_t exception;
45 | mach_msg_type_number_t codeCnt;
46 | int64_t code[2];
47 | int flavor;
48 | mach_msg_type_number_t old_stateCnt;
49 | natural_t old_state[224];
50 | } request_mach_exception_raise_t;
51 |
52 | // The reply_mach_exception_raise_state_t struct is passed to mach_msg which assumes its exact layout. To avoid problems with different layouts, we keep the definition in C rather than Swift.
53 | typedef struct
54 | {
55 | mach_msg_header_t Head;
56 | NDR_record_t NDR;
57 | kern_return_t RetCode;
58 | int flavor;
59 | mach_msg_type_number_t new_stateCnt;
60 | natural_t new_state[224];
61 | } reply_mach_exception_raise_state_t;
62 |
63 | typedef struct
64 | {
65 | mach_port_t exception_port;
66 | exception_type_t exception;
67 | mach_exception_data_type_t const * _Nullable code;
68 | mach_msg_type_number_t codeCnt;
69 | int32_t * _Nullable flavor;
70 | natural_t const * _Nullable old_state;
71 | mach_msg_type_number_t old_stateCnt;
72 | thread_state_t _Nullable new_state;
73 | mach_msg_type_number_t * _Nullable new_stateCnt;
74 | } bad_instruction_exception_reply_t;
75 |
76 | NS_ASSUME_NONNULL_END
77 |
78 | #endif
79 |
--------------------------------------------------------------------------------
/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlBadInstructionException.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CwlBadInstructionException.swift
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved.
7 | //
8 | // Permission to use, copy, modify, and/or distribute this software for any
9 | // purpose with or without fee is hereby granted, provided that the above
10 | // copyright notice and this permission notice appear in all copies.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 | //
20 |
21 | #if (os(macOS) || os(iOS)) && arch(x86_64)
22 |
23 | import Foundation
24 |
25 | #if canImport(NimbleCwlMachBadInstructionHandler)
26 | import NimbleCwlMachBadInstructionHandler
27 | #endif
28 |
29 | private func raiseBadInstructionException() {
30 | BadInstructionException().raise()
31 | }
32 |
33 | /// A simple NSException subclass. It's not required to subclass NSException (since the exception type is represented in the name) but this helps for identifying the exception through runtime type.
34 | @objc(BadInstructionException)
35 | public class BadInstructionException: NSException {
36 | static var name: String = "com.cocoawithlove.BadInstruction"
37 |
38 | init() {
39 | super.init(name: NSExceptionName(rawValue: BadInstructionException.name), reason: nil, userInfo: nil)
40 | }
41 |
42 | required public init?(coder aDecoder: NSCoder) {
43 | super.init(coder: aDecoder)
44 | }
45 |
46 | /// An Objective-C callable function, invoked from the `mach_exc_server` callback function `catch_mach_exception_raise_state` to push the `raiseBadInstructionException` function onto the stack.
47 | @objc(receiveReply:)
48 | public class func receiveReply(_ value: NSValue) -> NSNumber {
49 | var reply = bad_instruction_exception_reply_t(exception_port: 0, exception: 0, code: nil, codeCnt: 0, flavor: nil, old_state: nil, old_stateCnt: 0, new_state: nil, new_stateCnt: nil)
50 | withUnsafeMutablePointer(to: &reply) { value.getValue(UnsafeMutableRawPointer($0)) }
51 |
52 | let old_state: UnsafePointer = reply.old_state!
53 | let old_stateCnt: mach_msg_type_number_t = reply.old_stateCnt
54 | let new_state: thread_state_t = reply.new_state!
55 | let new_stateCnt: UnsafeMutablePointer = reply.new_stateCnt!
56 |
57 | // Make sure we've been given enough memory
58 | if old_stateCnt != x86_THREAD_STATE64_COUNT || new_stateCnt.pointee < x86_THREAD_STATE64_COUNT {
59 | return NSNumber(value: KERN_INVALID_ARGUMENT)
60 | }
61 |
62 | // Read the old thread state
63 | var state = old_state.withMemoryRebound(to: x86_thread_state64_t.self, capacity: 1) { return $0.pointee }
64 |
65 | // 1. Decrement the stack pointer
66 | state.__rsp -= __uint64_t(MemoryLayout.size)
67 |
68 | // 2. Save the old Instruction Pointer to the stack.
69 | if let pointer = UnsafeMutablePointer<__uint64_t>(bitPattern: UInt(state.__rsp)) {
70 | pointer.pointee = state.__rip
71 | } else {
72 | return NSNumber(value: KERN_INVALID_ARGUMENT)
73 | }
74 |
75 | // 3. Set the Instruction Pointer to the new function's address
76 | var f: @convention(c) () -> Void = raiseBadInstructionException
77 | withUnsafePointer(to: &f) {
78 | state.__rip = $0.withMemoryRebound(to: __uint64_t.self, capacity: 1) { return $0.pointee }
79 | }
80 |
81 | // Write the new thread state
82 | new_state.withMemoryRebound(to: x86_thread_state64_t.self, capacity: 1) { $0.pointee = state }
83 | new_stateCnt.pointee = x86_THREAD_STATE64_COUNT
84 |
85 | return NSNumber(value: KERN_SUCCESS)
86 | }
87 | }
88 |
89 | #endif
90 |
--------------------------------------------------------------------------------
/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CwlDarwinDefinitions.swift
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved.
7 | //
8 | // Permission to use, copy, modify, and/or distribute this software for any
9 | // purpose with or without fee is hereby granted, provided that the above
10 | // copyright notice and this permission notice appear in all copies.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 | //
20 |
21 | #if (os(macOS) || os(iOS)) && arch(x86_64)
22 |
23 | import Darwin
24 |
25 | // From /usr/include/mach/message.h
26 | // #define MACH_MSG_TYPE_MAKE_SEND 20 /* Must hold receive right */
27 | // #define MACH_MSGH_BITS_REMOTE(bits) \
28 | // ((bits) & MACH_MSGH_BITS_REMOTE_MASK)
29 | // #define MACH_MSGH_BITS(remote, local) /* legacy */ \
30 | // ((remote) | ((local) << 8))
31 | public let MACH_MSG_TYPE_MAKE_SEND: UInt32 = 20
32 | public func MACH_MSGH_BITS_REMOTE(_ bits: UInt32) -> UInt32 { return bits & UInt32(MACH_MSGH_BITS_REMOTE_MASK) }
33 | public func MACH_MSGH_BITS(_ remote: UInt32, _ local: UInt32) -> UInt32 { return ((remote) | ((local) << 8)) }
34 |
35 | // From /usr/include/mach/exception_types.h
36 | // #define EXC_BAD_INSTRUCTION 2 /* Instruction failed */
37 | // #define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION)
38 | public let EXC_BAD_INSTRUCTION: UInt32 = 2
39 | public let EXC_MASK_BAD_INSTRUCTION: UInt32 = 1 << EXC_BAD_INSTRUCTION
40 |
41 | // From /usr/include/mach/i386/thread_status.h
42 | // #define x86_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \
43 | // ( sizeof (x86_thread_state64_t) / sizeof (int) ))
44 | public let x86_THREAD_STATE64_COUNT = UInt32(MemoryLayout.size / MemoryLayout.size)
45 |
46 | public let EXC_TYPES_COUNT = 14
47 | public struct execTypesCountTuple {
48 | // From /usr/include/mach/i386/exception.h
49 | // #define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */
50 | public var value: (T, T, T, T, T, T, T, T, T, T, T, T, T, T) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
51 | public init() {
52 | }
53 | }
54 |
55 | #endif
56 |
--------------------------------------------------------------------------------
/Pods/Nimble/Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/include/CwlPreconditionTesting.h:
--------------------------------------------------------------------------------
1 | //
2 | // CwlPreconditionTesting.h
3 | // CwlPreconditionTesting
4 | //
5 | // Created by Matt Gallagher on 2016/01/10.
6 | // Copyright © 2016 Matt Gallagher ( https://www.cocoawithlove.com ). All rights reserved.
7 | //
8 | // Permission to use, copy, modify, and/or distribute this software for any
9 | // purpose with or without fee is hereby granted, provided that the above
10 | // copyright notice and this permission notice appear in all copies.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
15 | // SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
18 | // IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 | //
20 |
21 | #import
22 |
23 | //! Project version number for CwlUtils.
24 | FOUNDATION_EXPORT double CwlPreconditionTestingVersionNumber;
25 |
26 | //! Project version string for CwlUtils.
27 | FOUNDATION_EXPORT const unsigned char CwlAssertingTestingVersionString[];
28 |
29 | #import "CwlMachBadInstructionHandler.h"
30 |
31 | #if TARGET_OS_OSX || TARGET_OS_IOS
32 | #import "CwlCatchException.h"
33 | #elif !TARGET_OS_TV
34 | #error Unsupported platform.
35 | #endif
36 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Adapters/AdapterProtocols.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// Protocol for the assertion handler that Nimble uses for all expectations.
4 | public protocol AssertionHandler {
5 | func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation)
6 | }
7 |
8 | /// Global backing interface for assertions that Nimble creates.
9 | /// Defaults to a private test handler that passes through to XCTest.
10 | ///
11 | /// If XCTest is not available, you must assign your own assertion handler
12 | /// before using any matchers, otherwise Nimble will abort the program.
13 | ///
14 | /// @see AssertionHandler
15 | public var NimbleAssertionHandler: AssertionHandler = { () -> AssertionHandler in
16 | // swiftlint:disable:previous identifier_name
17 | return isXCTestAvailable() ? NimbleXCTestHandler() : NimbleXCTestUnavailableHandler()
18 | }()
19 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Adapters/AssertionDispatcher.swift:
--------------------------------------------------------------------------------
1 | /// AssertionDispatcher allows multiple AssertionHandlers to receive
2 | /// assertion messages.
3 | ///
4 | /// @warning Does not fully dispatch if one of the handlers raises an exception.
5 | /// This is possible with XCTest-based assertion handlers.
6 | ///
7 | public class AssertionDispatcher: AssertionHandler {
8 | let handlers: [AssertionHandler]
9 |
10 | public init(handlers: [AssertionHandler]) {
11 | self.handlers = handlers
12 | }
13 |
14 | public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) {
15 | for handler in handlers {
16 | handler.assert(assertion, message: message, location: location)
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Adapters/NMBObjCMatcher.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if canImport(Darwin)
4 |
5 | // swiftlint:disable line_length
6 | public typealias MatcherBlock = (_ actualExpression: Expression, _ failureMessage: FailureMessage) throws -> Bool
7 | public typealias FullMatcherBlock = (_ actualExpression: Expression, _ failureMessage: FailureMessage, _ shouldNotMatch: Bool) throws -> Bool
8 | // swiftlint:enable line_length
9 |
10 | public class NMBObjCMatcher: NSObject, NMBMatcher {
11 | // swiftlint:disable identifier_name
12 | let _match: MatcherBlock
13 | let _doesNotMatch: MatcherBlock
14 | // swiftlint:enable identifier_name
15 | let canMatchNil: Bool
16 |
17 | public init(canMatchNil: Bool, matcher: @escaping MatcherBlock, notMatcher: @escaping MatcherBlock) {
18 | self.canMatchNil = canMatchNil
19 | self._match = matcher
20 | self._doesNotMatch = notMatcher
21 | }
22 |
23 | public convenience init(matcher: @escaping MatcherBlock) {
24 | self.init(canMatchNil: true, matcher: matcher)
25 | }
26 |
27 | public convenience init(canMatchNil: Bool, matcher: @escaping MatcherBlock) {
28 | self.init(canMatchNil: canMatchNil, matcher: matcher, notMatcher: ({ actualExpression, failureMessage in
29 | return try !matcher(actualExpression, failureMessage)
30 | }))
31 | }
32 |
33 | public convenience init(matcher: @escaping FullMatcherBlock) {
34 | self.init(canMatchNil: true, matcher: matcher)
35 | }
36 |
37 | public convenience init(canMatchNil: Bool, matcher: @escaping FullMatcherBlock) {
38 | self.init(canMatchNil: canMatchNil, matcher: ({ actualExpression, failureMessage in
39 | return try matcher(actualExpression, failureMessage, false)
40 | }), notMatcher: ({ actualExpression, failureMessage in
41 | return try matcher(actualExpression, failureMessage, true)
42 | }))
43 | }
44 |
45 | private func canMatch(_ actualExpression: Expression, failureMessage: FailureMessage) -> Bool {
46 | do {
47 | if !canMatchNil {
48 | if try actualExpression.evaluate() == nil {
49 | failureMessage.postfixActual = " (use beNil() to match nils)"
50 | return false
51 | }
52 | }
53 | } catch let error {
54 | failureMessage.actualValue = "an unexpected error thrown: \(error)"
55 | return false
56 | }
57 | return true
58 | }
59 |
60 | public func matches(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
61 | let expr = Expression(expression: actualBlock, location: location)
62 | let result: Bool
63 | do {
64 | result = try _match(expr, failureMessage)
65 | } catch let error {
66 | failureMessage.stringValue = "unexpected error thrown: <\(error)>"
67 | return false
68 | }
69 |
70 | if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) {
71 | return result
72 | } else {
73 | return false
74 | }
75 | }
76 |
77 | public func doesNotMatch(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
78 | let expr = Expression(expression: actualBlock, location: location)
79 | let result: Bool
80 | do {
81 | result = try _doesNotMatch(expr, failureMessage)
82 | } catch let error {
83 | failureMessage.stringValue = "unexpected error thrown: <\(error)>"
84 | return false
85 | }
86 |
87 | if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) {
88 | return result
89 | } else {
90 | return false
91 | }
92 | }
93 | }
94 |
95 | #endif
96 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Adapters/NimbleEnvironment.swift:
--------------------------------------------------------------------------------
1 | import Dispatch
2 | import Foundation
3 |
4 | /// "Global" state of Nimble is stored here. Only DSL functions should access / be aware of this
5 | /// class' existence
6 | internal class NimbleEnvironment: NSObject {
7 | static var activeInstance: NimbleEnvironment {
8 | get {
9 | let env = Thread.current.threadDictionary["NimbleEnvironment"]
10 | if let env = env as? NimbleEnvironment {
11 | return env
12 | } else {
13 | let newEnv = NimbleEnvironment()
14 | self.activeInstance = newEnv
15 | return newEnv
16 | }
17 | }
18 | set {
19 | Thread.current.threadDictionary["NimbleEnvironment"] = newValue
20 | }
21 | }
22 |
23 | // swiftlint:disable:next todo
24 | // TODO: eventually migrate the global to this environment value
25 | var assertionHandler: AssertionHandler {
26 | get { return NimbleAssertionHandler }
27 | set { NimbleAssertionHandler = newValue }
28 | }
29 |
30 | var suppressTVOSAssertionWarning: Bool = false
31 | var awaiter: Awaiter
32 |
33 | override init() {
34 | let timeoutQueue = DispatchQueue.global(qos: .userInitiated)
35 | awaiter = Awaiter(
36 | waitLock: AssertionWaitLock(),
37 | asyncQueue: .main,
38 | timeoutQueue: timeoutQueue
39 | )
40 |
41 | super.init()
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Adapters/NimbleXCTestHandler.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import XCTest
3 |
4 | /// Default handler for Nimble. This assertion handler passes failures along to
5 | /// XCTest.
6 | public class NimbleXCTestHandler: AssertionHandler {
7 | public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) {
8 | if !assertion {
9 | recordFailure("\(message.stringValue)\n", location: location)
10 | }
11 | }
12 | }
13 |
14 | /// Alternative handler for Nimble. This assertion handler passes failures along
15 | /// to XCTest by attempting to reduce the failure message size.
16 | public class NimbleShortXCTestHandler: AssertionHandler {
17 | public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) {
18 | if !assertion {
19 | let msg: String
20 | if let actual = message.actualValue {
21 | msg = "got: \(actual) \(message.postfixActual)"
22 | } else {
23 | msg = "expected \(message.to) \(message.postfixMessage)"
24 | }
25 | recordFailure("\(msg)\n", location: location)
26 | }
27 | }
28 | }
29 |
30 | /// Fallback handler in case XCTest is unavailable. This assertion handler will abort
31 | /// the program if it is invoked.
32 | class NimbleXCTestUnavailableHandler: AssertionHandler {
33 | func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) {
34 | fatalError("XCTest is not available and no custom assertion handler was configured. Aborting.")
35 | }
36 | }
37 |
38 | #if !SWIFT_PACKAGE
39 | /// Helper class providing access to the currently executing XCTestCase instance, if any
40 | @objc final internal class CurrentTestCaseTracker: NSObject, XCTestObservation {
41 | @objc static let sharedInstance = CurrentTestCaseTracker()
42 |
43 | private(set) var currentTestCase: XCTestCase?
44 |
45 | private var stashed_swift_reportFatalErrorsToDebugger: Bool = false
46 |
47 | @objc func testCaseWillStart(_ testCase: XCTestCase) {
48 | #if swift(>=3.2) && !os(tvOS)
49 | stashed_swift_reportFatalErrorsToDebugger = _swift_reportFatalErrorsToDebugger
50 | _swift_reportFatalErrorsToDebugger = false
51 | #endif
52 |
53 | currentTestCase = testCase
54 | }
55 |
56 | @objc func testCaseDidFinish(_ testCase: XCTestCase) {
57 | currentTestCase = nil
58 |
59 | #if swift(>=3.2) && !os(tvOS)
60 | _swift_reportFatalErrorsToDebugger = stashed_swift_reportFatalErrorsToDebugger
61 | #endif
62 | }
63 | }
64 | #endif
65 |
66 | func isXCTestAvailable() -> Bool {
67 | #if canImport(Darwin)
68 | // XCTest is weakly linked and so may not be present
69 | return NSClassFromString("XCTestCase") != nil
70 | #else
71 | return true
72 | #endif
73 | }
74 |
75 | public func recordFailure(_ message: String, location: SourceLocation) {
76 | #if SWIFT_PACKAGE
77 | XCTFail("\(message)", file: location.file, line: location.line)
78 | #else
79 | if let testCase = CurrentTestCaseTracker.sharedInstance.currentTestCase {
80 | let line = Int(location.line)
81 | testCase.recordFailure(withDescription: message, inFile: location.file, atLine: line, expected: true)
82 | } else {
83 | let msg = """
84 | Attempted to report a test failure to XCTest while no test case was running. The failure was:
85 | \"\(message)\"
86 | It occurred at: \(location.file):\(location.line)
87 | """
88 | NSException(name: .internalInconsistencyException, reason: msg, userInfo: nil).raise()
89 | }
90 | #endif
91 | }
92 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/DSL.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// Make an expectation on a given actual value. The value given is lazily evaluated.
4 | public func expect(_ expression: @autoclosure @escaping () throws -> T?, file: FileString = #file, line: UInt = #line) -> Expectation {
5 | return Expectation(
6 | expression: Expression(
7 | expression: expression,
8 | location: SourceLocation(file: file, line: line),
9 | isClosure: true))
10 | }
11 |
12 | /// Make an expectation on a given actual value. The closure is lazily invoked.
13 | public func expect(_ file: FileString = #file, line: UInt = #line, expression: @escaping () throws -> T?) -> Expectation {
14 | return Expectation(
15 | expression: Expression(
16 | expression: expression,
17 | location: SourceLocation(file: file, line: line),
18 | isClosure: true))
19 | }
20 |
21 | /// Always fails the test with a message and a specified location.
22 | public func fail(_ message: String, location: SourceLocation) {
23 | let handler = NimbleEnvironment.activeInstance.assertionHandler
24 | handler.assert(false, message: FailureMessage(stringValue: message), location: location)
25 | }
26 |
27 | /// Always fails the test with a message.
28 | public func fail(_ message: String, file: FileString = #file, line: UInt = #line) {
29 | fail(message, location: SourceLocation(file: file, line: line))
30 | }
31 |
32 | /// Always fails the test.
33 | public func fail(_ file: FileString = #file, line: UInt = #line) {
34 | fail("fail() always fails", file: file, line: line)
35 | }
36 |
37 | /// Like Swift's precondition(), but raises NSExceptions instead of sigaborts
38 | internal func nimblePrecondition(
39 | _ expr: @autoclosure() -> Bool,
40 | _ name: @autoclosure() -> String,
41 | _ message: @autoclosure() -> String,
42 | file: StaticString = #file,
43 | line: UInt = #line) {
44 | let result = expr()
45 | if !result {
46 | #if canImport(Darwin)
47 | let exception = NSException(
48 | name: NSExceptionName(name()),
49 | reason: message(),
50 | userInfo: nil
51 | )
52 | exception.raise()
53 | #else
54 | preconditionFailure("\(name()) - \(message())", file: file, line: line)
55 | #endif
56 | }
57 | }
58 |
59 | internal func internalError(_ msg: String, file: FileString = #file, line: UInt = #line) -> Never {
60 | // swiftlint:disable line_length
61 | fatalError(
62 | """
63 | Nimble Bug Found: \(msg) at \(file):\(line).
64 | Please file a bug to Nimble: https://github.com/Quick/Nimble/issues with the code snippet that caused this error.
65 | """
66 | )
67 | // swiftlint:enable line_length
68 | }
69 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Expectation.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // Deprecated
4 | internal func expressionDoesNotMatch(_ expression: Expression, matcher: U, toNot: String, description: String?) -> (Bool, FailureMessage)
5 | where U: Matcher, U.ValueType == T {
6 | let msg = FailureMessage()
7 | msg.userDescription = description
8 | msg.to = toNot
9 | do {
10 | let pass = try matcher.doesNotMatch(expression, failureMessage: msg)
11 | if msg.actualValue == "" {
12 | msg.actualValue = "<\(stringify(try expression.evaluate()))>"
13 | }
14 | return (pass, msg)
15 | } catch let error {
16 | msg.stringValue = "unexpected error thrown: <\(error)>"
17 | return (false, msg)
18 | }
19 | }
20 |
21 | internal func execute(_ expression: Expression, _ style: ExpectationStyle, _ predicate: Predicate, to: String, description: String?, captureExceptions: Bool = true) -> (Bool, FailureMessage) {
22 | func run() -> (Bool, FailureMessage) {
23 | let msg = FailureMessage()
24 | msg.userDescription = description
25 | msg.to = to
26 | do {
27 | let result = try predicate.satisfies(expression)
28 | result.message.update(failureMessage: msg)
29 | if msg.actualValue == "" {
30 | msg.actualValue = "<\(stringify(try expression.evaluate()))>"
31 | }
32 | return (result.toBoolean(expectation: style), msg)
33 | } catch let error {
34 | msg.stringValue = "unexpected error thrown: <\(error)>"
35 | return (false, msg)
36 | }
37 | }
38 |
39 | var result: (Bool, FailureMessage) = (false, FailureMessage())
40 | if captureExceptions {
41 | let capture = NMBExceptionCapture(handler: ({ exception -> Void in
42 | let msg = FailureMessage()
43 | msg.stringValue = "unexpected exception raised: \(exception)"
44 | result = (false, msg)
45 | }), finally: nil)
46 | capture.tryBlock {
47 | result = run()
48 | }
49 | } else {
50 | result = run()
51 | }
52 |
53 | return result
54 | }
55 |
56 | public struct Expectation {
57 |
58 | public let expression: Expression
59 |
60 | public init(expression: Expression) {
61 | self.expression = expression
62 | }
63 |
64 | public func verify(_ pass: Bool, _ message: FailureMessage) {
65 | let handler = NimbleEnvironment.activeInstance.assertionHandler
66 | handler.assert(pass, message: message, location: expression.location)
67 | }
68 |
69 | ////////////////// OLD API /////////////////////
70 |
71 | /// DEPRECATED: Tests the actual value using a matcher to match.
72 | public func to(_ matcher: U, description: String? = nil)
73 | where U: Matcher, U.ValueType == T {
74 | let (pass, msg) = execute(
75 | expression,
76 | .toMatch,
77 | matcher.predicate,
78 | to: "to",
79 | description: description,
80 | captureExceptions: false
81 | )
82 | verify(pass, msg)
83 | }
84 |
85 | /// DEPRECATED: Tests the actual value using a matcher to not match.
86 | public func toNot(_ matcher: U, description: String? = nil)
87 | where U: Matcher, U.ValueType == T {
88 | // swiftlint:disable:next line_length
89 | let (pass, msg) = expressionDoesNotMatch(expression, matcher: matcher, toNot: "to not", description: description)
90 | verify(pass, msg)
91 | }
92 |
93 | /// DEPRECATED: Tests the actual value using a matcher to not match.
94 | ///
95 | /// Alias to toNot().
96 | public func notTo(_ matcher: U, description: String? = nil)
97 | where U: Matcher, U.ValueType == T {
98 | toNot(matcher, description: description)
99 | }
100 |
101 | ////////////////// NEW API /////////////////////
102 |
103 | /// Tests the actual value using a matcher to match.
104 | public func to(_ predicate: Predicate, description: String? = nil) {
105 | let (pass, msg) = execute(expression, .toMatch, predicate, to: "to", description: description)
106 | verify(pass, msg)
107 | }
108 |
109 | /// Tests the actual value using a matcher to not match.
110 | public func toNot(_ predicate: Predicate, description: String? = nil) {
111 | let (pass, msg) = execute(expression, .toNotMatch, predicate, to: "to not", description: description)
112 | verify(pass, msg)
113 | }
114 |
115 | /// Tests the actual value using a matcher to not match.
116 | ///
117 | /// Alias to toNot().
118 | public func notTo(_ predicate: Predicate, description: String? = nil) {
119 | toNot(predicate, description: description)
120 | }
121 |
122 | // see:
123 | // - `async` for extension
124 | // - NMBExpectation for Objective-C interface
125 | }
126 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Expression.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // Memoizes the given closure, only calling the passed
4 | // closure once; even if repeat calls to the returned closure
5 | internal func memoizedClosure(_ closure: @escaping () throws -> T) -> (Bool) throws -> T {
6 | var cache: T?
7 | return { withoutCaching in
8 | if withoutCaching || cache == nil {
9 | cache = try closure()
10 | }
11 | return cache!
12 | }
13 | }
14 |
15 | /// Expression represents the closure of the value inside expect(...).
16 | /// Expressions are memoized by default. This makes them safe to call
17 | /// evaluate() multiple times without causing a re-evaluation of the underlying
18 | /// closure.
19 | ///
20 | /// @warning Since the closure can be any code, Objective-C code may choose
21 | /// to raise an exception. Currently, Expression does not memoize
22 | /// exception raising.
23 | ///
24 | /// This provides a common consumable API for matchers to utilize to allow
25 | /// Nimble to change internals to how the captured closure is managed.
26 | public struct Expression {
27 | // swiftlint:disable identifier_name
28 | internal let _expression: (Bool) throws -> T?
29 | internal let _withoutCaching: Bool
30 | // swiftlint:enable identifier_name
31 | public let location: SourceLocation
32 | public let isClosure: Bool
33 |
34 | /// Creates a new expression struct. Normally, expect(...) will manage this
35 | /// creation process. The expression is memoized.
36 | ///
37 | /// @param expression The closure that produces a given value.
38 | /// @param location The source location that this closure originates from.
39 | /// @param isClosure A bool indicating if the captured expression is a
40 | /// closure or internally produced closure. Some matchers
41 | /// may require closures. For example, toEventually()
42 | /// requires an explicit closure. This gives Nimble
43 | /// flexibility if @autoclosure behavior changes between
44 | /// Swift versions. Nimble internals always sets this true.
45 | public init(expression: @escaping () throws -> T?, location: SourceLocation, isClosure: Bool = true) {
46 | self._expression = memoizedClosure(expression)
47 | self.location = location
48 | self._withoutCaching = false
49 | self.isClosure = isClosure
50 | }
51 |
52 | /// Creates a new expression struct. Normally, expect(...) will manage this
53 | /// creation process.
54 | ///
55 | /// @param expression The closure that produces a given value.
56 | /// @param location The source location that this closure originates from.
57 | /// @param withoutCaching Indicates if the struct should memoize the given
58 | /// closure's result. Subsequent evaluate() calls will
59 | /// not call the given closure if this is true.
60 | /// @param isClosure A bool indicating if the captured expression is a
61 | /// closure or internally produced closure. Some matchers
62 | /// may require closures. For example, toEventually()
63 | /// requires an explicit closure. This gives Nimble
64 | /// flexibility if @autoclosure behavior changes between
65 | /// Swift versions. Nimble internals always sets this true.
66 | public init(memoizedExpression: @escaping (Bool) throws -> T?, location: SourceLocation, withoutCaching: Bool, isClosure: Bool = true) {
67 | self._expression = memoizedExpression
68 | self.location = location
69 | self._withoutCaching = withoutCaching
70 | self.isClosure = isClosure
71 | }
72 |
73 | /// Returns a new Expression from the given expression. Identical to a map()
74 | /// on this type. This should be used only to typecast the Expression's
75 | /// closure value.
76 | ///
77 | /// The returned expression will preserve location and isClosure.
78 | ///
79 | /// @param block The block that can cast the current Expression value to a
80 | /// new type.
81 | public func cast(_ block: @escaping (T?) throws -> U?) -> Expression {
82 | return Expression(
83 | expression: ({ try block(self.evaluate()) }),
84 | location: self.location,
85 | isClosure: self.isClosure
86 | )
87 | }
88 |
89 | public func evaluate() throws -> T? {
90 | return try self._expression(_withoutCaching)
91 | }
92 |
93 | public func withoutCaching() -> Expression {
94 | return Expression(
95 | memoizedExpression: self._expression,
96 | location: location,
97 | withoutCaching: true,
98 | isClosure: isClosure
99 | )
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/FailureMessage.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// Encapsulates the failure message that matchers can report to the end user.
4 | ///
5 | /// This is shared state between Nimble and matchers that mutate this value.
6 | public class FailureMessage: NSObject {
7 | public var expected: String = "expected"
8 | public var actualValue: String? = "" // empty string -> use default; nil -> exclude
9 | public var to: String = "to"
10 | public var postfixMessage: String = "match"
11 | public var postfixActual: String = ""
12 | /// An optional message that will be appended as a new line and provides additional details
13 | /// about the failure. This message will only be visible in the issue navigator / in logs but
14 | /// not directly in the source editor since only a single line is presented there.
15 | public var extendedMessage: String?
16 | public var userDescription: String?
17 |
18 | public var stringValue: String {
19 | get {
20 | if let value = _stringValueOverride {
21 | return value
22 | } else {
23 | return computeStringValue()
24 | }
25 | }
26 | set {
27 | _stringValueOverride = newValue
28 | }
29 | }
30 |
31 | // swiftlint:disable:next identifier_name
32 | internal var _stringValueOverride: String?
33 | internal var hasOverriddenStringValue: Bool {
34 | return _stringValueOverride != nil
35 | }
36 |
37 | public override init() {
38 | }
39 |
40 | public init(stringValue: String) {
41 | _stringValueOverride = stringValue
42 | }
43 |
44 | internal func stripNewlines(_ str: String) -> String {
45 | let whitespaces = CharacterSet.whitespacesAndNewlines
46 | return str
47 | .components(separatedBy: "\n")
48 | .map { line in line.trimmingCharacters(in: whitespaces) }
49 | .joined(separator: "")
50 | }
51 |
52 | internal func computeStringValue() -> String {
53 | var value = "\(expected) \(to) \(postfixMessage)"
54 | if let actualValue = actualValue {
55 | value = "\(expected) \(to) \(postfixMessage), got \(actualValue)\(postfixActual)"
56 | }
57 | value = stripNewlines(value)
58 |
59 | if let extendedMessage = extendedMessage {
60 | value += "\n\(stripNewlines(extendedMessage))"
61 | }
62 |
63 | if let userDescription = userDescription {
64 | return "\(userDescription)\n\(value)"
65 | }
66 |
67 | return value
68 | }
69 |
70 | internal func appendMessage(_ msg: String) {
71 | if hasOverriddenStringValue {
72 | stringValue += "\(msg)"
73 | } else if actualValue != nil {
74 | postfixActual += msg
75 | } else {
76 | postfixMessage += msg
77 | }
78 | }
79 |
80 | internal func appendDetails(_ msg: String) {
81 | if hasOverriddenStringValue {
82 | if let desc = userDescription {
83 | stringValue = "\(desc)\n\(stringValue)"
84 | }
85 | stringValue += "\n\(msg)"
86 | } else {
87 | if let desc = userDescription {
88 | userDescription = desc
89 | }
90 | extendedMessage = msg
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeAKindOf.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | private func matcherMessage(forType expectedType: T.Type) -> String {
4 | return "be a kind of \(String(describing: expectedType))"
5 | }
6 | private func matcherMessage(forClass expectedClass: AnyClass) -> String {
7 | return "be a kind of \(String(describing: expectedClass))"
8 | }
9 |
10 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class.
11 | public func beAKindOf(_ expectedType: T.Type) -> Predicate {
12 | return Predicate.define { actualExpression in
13 | let message: ExpectationMessage
14 |
15 | let instance = try actualExpression.evaluate()
16 | guard let validInstance = instance else {
17 | message = .expectedCustomValueTo(matcherMessage(forType: expectedType), "")
18 | return PredicateResult(status: .fail, message: message)
19 | }
20 | message = .expectedCustomValueTo(
21 | "be a kind of \(String(describing: expectedType))",
22 | "<\(String(describing: type(of: validInstance))) instance>"
23 | )
24 |
25 | return PredicateResult(
26 | bool: validInstance is T,
27 | message: message
28 | )
29 | }
30 | }
31 |
32 | #if canImport(Darwin)
33 |
34 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class.
35 | /// @see beAnInstanceOf if you want to match against the exact class
36 | public func beAKindOf(_ expectedClass: AnyClass) -> Predicate {
37 | return Predicate.define { actualExpression in
38 | let message: ExpectationMessage
39 | let status: PredicateStatus
40 |
41 | let instance = try actualExpression.evaluate()
42 | if let validInstance = instance {
43 | status = PredicateStatus(bool: instance != nil && instance!.isKind(of: expectedClass))
44 | message = .expectedCustomValueTo(
45 | matcherMessage(forClass: expectedClass),
46 | "<\(String(describing: type(of: validInstance))) instance>"
47 | )
48 | } else {
49 | status = .fail
50 | message = .expectedCustomValueTo(
51 | matcherMessage(forClass: expectedClass),
52 | ""
53 | )
54 | }
55 |
56 | return PredicateResult(status: status, message: message)
57 | }
58 | }
59 |
60 | extension NMBObjCMatcher {
61 | @objc public class func beAKindOfMatcher(_ expected: AnyClass) -> NMBMatcher {
62 | return NMBPredicate { actualExpression in
63 | return try beAKindOf(expected).satisfies(actualExpression).toObjectiveC()
64 | }
65 | }
66 | }
67 |
68 | #endif
69 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeAnInstanceOf.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is an _exact_ instance of the given class.
4 | public func beAnInstanceOf(_ expectedType: T.Type) -> Predicate {
5 | let errorMessage = "be an instance of \(String(describing: expectedType))"
6 | return Predicate.define { actualExpression in
7 | let instance = try actualExpression.evaluate()
8 | guard let validInstance = instance else {
9 | return PredicateResult(
10 | status: .doesNotMatch,
11 | message: .expectedActualValueTo(errorMessage)
12 | )
13 | }
14 |
15 | let actualString = "<\(String(describing: type(of: validInstance))) instance>"
16 |
17 | return PredicateResult(
18 | status: PredicateStatus(bool: type(of: validInstance) == expectedType),
19 | message: .expectedCustomValueTo(errorMessage, actualString)
20 | )
21 | }
22 | }
23 |
24 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class.
25 | /// @see beAKindOf if you want to match against subclasses
26 | public func beAnInstanceOf(_ expectedClass: AnyClass) -> Predicate {
27 | let errorMessage = "be an instance of \(String(describing: expectedClass))"
28 | return Predicate.define { actualExpression in
29 | let instance = try actualExpression.evaluate()
30 | let actualString: String
31 | if let validInstance = instance {
32 | actualString = "<\(String(describing: type(of: validInstance))) instance>"
33 | } else {
34 | actualString = ""
35 | }
36 | #if canImport(Darwin)
37 | let matches = instance != nil && instance!.isMember(of: expectedClass)
38 | #else
39 | let matches = instance != nil && type(of: instance!) == expectedClass
40 | #endif
41 | return PredicateResult(
42 | status: PredicateStatus(bool: matches),
43 | message: .expectedCustomValueTo(errorMessage, actualString)
44 | )
45 | }
46 | }
47 |
48 | #if canImport(Darwin)
49 | extension NMBObjCMatcher {
50 | @objc public class func beAnInstanceOfMatcher(_ expected: AnyClass) -> NMBMatcher {
51 | return NMBPredicate { actualExpression in
52 | return try beAnInstanceOf(expected).satisfies(actualExpression).toObjectiveC()
53 | }
54 | }
55 | }
56 | #endif
57 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value.
4 | public func beGreaterThan(_ expectedValue: T?) -> Predicate {
5 | let errorMessage = "be greater than <\(stringify(expectedValue))>"
6 | return Predicate.simple(errorMessage) { actualExpression in
7 | if let actual = try actualExpression.evaluate(), let expected = expectedValue {
8 | return PredicateStatus(bool: actual > expected)
9 | }
10 | return .fail
11 | }
12 | }
13 |
14 | public func >(lhs: Expectation, rhs: T) {
15 | lhs.to(beGreaterThan(rhs))
16 | }
17 |
18 | #if canImport(Darwin) || !compiler(>=5.1)
19 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value.
20 | public func beGreaterThan(_ expectedValue: NMBComparable?) -> Predicate {
21 | let errorMessage = "be greater than <\(stringify(expectedValue))>"
22 | return Predicate.simple(errorMessage) { actualExpression in
23 | let actualValue = try actualExpression.evaluate()
24 | let matches = actualValue != nil
25 | && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedDescending
26 | return PredicateStatus(bool: matches)
27 | }
28 | }
29 |
30 | public func > (lhs: Expectation, rhs: NMBComparable?) {
31 | lhs.to(beGreaterThan(rhs))
32 | }
33 | #endif
34 |
35 | #if canImport(Darwin)
36 | extension NMBObjCMatcher {
37 | @objc public class func beGreaterThanMatcher(_ expected: NMBComparable?) -> NMBMatcher {
38 | return NMBPredicate { actualExpression in
39 | let expr = actualExpression.cast { $0 as? NMBComparable }
40 | return try beGreaterThan(expected).satisfies(expr).toObjectiveC()
41 | }
42 | }
43 | }
44 | #endif
45 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is greater than
4 | /// or equal to the expected value.
5 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate {
6 | let message = "be greater than or equal to <\(stringify(expectedValue))>"
7 | return Predicate.simple(message) { actualExpression in
8 | let actualValue = try actualExpression.evaluate()
9 | if let actual = actualValue, let expected = expectedValue {
10 | return PredicateStatus(bool: actual >= expected)
11 | }
12 | return .fail
13 | }
14 | }
15 |
16 | public func >=(lhs: Expectation, rhs: T) {
17 | lhs.to(beGreaterThanOrEqualTo(rhs))
18 | }
19 |
20 | #if canImport(Darwin) || !compiler(>=5.1)
21 | /// A Nimble matcher that succeeds when the actual value is greater than
22 | /// or equal to the expected value.
23 | public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate {
24 | let message = "be greater than or equal to <\(stringify(expectedValue))>"
25 | return Predicate.simple(message) { actualExpression in
26 | let actualValue = try actualExpression.evaluate()
27 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) != ComparisonResult.orderedAscending
28 | return PredicateStatus(bool: matches)
29 | }
30 | }
31 |
32 | public func >=(lhs: Expectation, rhs: T) {
33 | lhs.to(beGreaterThanOrEqualTo(rhs))
34 | }
35 | #endif
36 |
37 | #if canImport(Darwin)
38 | extension NMBObjCMatcher {
39 | @objc public class func beGreaterThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBMatcher {
40 | return NMBPredicate { actualExpression in
41 | let expr = actualExpression.cast { $0 as? NMBComparable }
42 | return try beGreaterThanOrEqualTo(expected).satisfies(expr).toObjectiveC()
43 | }
44 | }
45 | }
46 | #endif
47 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeIdenticalTo.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is the same instance
4 | /// as the expected instance.
5 | public func beIdenticalTo(_ expected: Any?) -> Predicate {
6 | return Predicate.define { actualExpression in
7 | let actual = try actualExpression.evaluate() as AnyObject?
8 |
9 | let bool = actual === (expected as AnyObject?) && actual !== nil
10 | return PredicateResult(
11 | bool: bool,
12 | message: .expectedCustomValueTo(
13 | "be identical to \(identityAsString(expected))",
14 | "\(identityAsString(actual))"
15 | )
16 | )
17 | }
18 | }
19 |
20 | public func === (lhs: Expectation, rhs: Any?) {
21 | lhs.to(beIdenticalTo(rhs))
22 | }
23 | public func !== (lhs: Expectation, rhs: Any?) {
24 | lhs.toNot(beIdenticalTo(rhs))
25 | }
26 |
27 | /// A Nimble matcher that succeeds when the actual value is the same instance
28 | /// as the expected instance.
29 | ///
30 | /// Alias for "beIdenticalTo".
31 | public func be(_ expected: Any?) -> Predicate {
32 | return beIdenticalTo(expected)
33 | }
34 |
35 | #if canImport(Darwin)
36 | extension NMBObjCMatcher {
37 | @objc public class func beIdenticalToMatcher(_ expected: NSObject?) -> NMBMatcher {
38 | return NMBPredicate { actualExpression in
39 | let aExpr = actualExpression.cast { $0 as Any? }
40 | return try beIdenticalTo(expected).satisfies(aExpr).toObjectiveC()
41 | }
42 | }
43 | }
44 | #endif
45 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeLessThan.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is less than the expected value.
4 | public func beLessThan(_ expectedValue: T?) -> Predicate {
5 | let message = "be less than <\(stringify(expectedValue))>"
6 | return Predicate.simple(message) { actualExpression in
7 | if let actual = try actualExpression.evaluate(), let expected = expectedValue {
8 | return PredicateStatus(bool: actual < expected)
9 | }
10 | return .fail
11 | }
12 | }
13 |
14 | public func <(lhs: Expectation, rhs: T) {
15 | lhs.to(beLessThan(rhs))
16 | }
17 |
18 | #if canImport(Darwin) || !compiler(>=5.1)
19 | /// A Nimble matcher that succeeds when the actual value is less than the expected value.
20 | public func beLessThan(_ expectedValue: NMBComparable?) -> Predicate {
21 | let message = "be less than <\(stringify(expectedValue))>"
22 | return Predicate.simple(message) { actualExpression in
23 | let actualValue = try actualExpression.evaluate()
24 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedAscending
25 | return PredicateStatus(bool: matches)
26 | }
27 | }
28 |
29 | public func < (lhs: Expectation, rhs: NMBComparable?) {
30 | lhs.to(beLessThan(rhs))
31 | }
32 | #endif
33 |
34 | #if canImport(Darwin)
35 | extension NMBObjCMatcher {
36 | @objc public class func beLessThanMatcher(_ expected: NMBComparable?) -> NMBMatcher {
37 | return NMBPredicate { actualExpression in
38 | let expr = actualExpression.cast { $0 as? NMBComparable }
39 | return try beLessThan(expected).satisfies(expr).toObjectiveC()
40 | }
41 | }
42 | }
43 | #endif
44 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeLessThanOrEqual.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is less than
4 | /// or equal to the expected value.
5 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate {
6 | return Predicate.simple("be less than or equal to <\(stringify(expectedValue))>") { actualExpression in
7 | if let actual = try actualExpression.evaluate(), let expected = expectedValue {
8 | return PredicateStatus(bool: actual <= expected)
9 | }
10 | return .fail
11 | }
12 | }
13 |
14 | public func <=(lhs: Expectation, rhs: T) {
15 | lhs.to(beLessThanOrEqualTo(rhs))
16 | }
17 |
18 | #if canImport(Darwin) || !compiler(>=5.1)
19 | /// A Nimble matcher that succeeds when the actual value is less than
20 | /// or equal to the expected value.
21 | public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate {
22 | return Predicate.simple("be less than or equal to <\(stringify(expectedValue))>") { actualExpression in
23 | let actualValue = try actualExpression.evaluate()
24 | let matches = actualValue.map { $0.NMB_compare(expectedValue) != .orderedDescending } ?? false
25 | return PredicateStatus(bool: matches)
26 | }
27 | }
28 |
29 | public func <=(lhs: Expectation, rhs: T) {
30 | lhs.to(beLessThanOrEqualTo(rhs))
31 | }
32 | #endif
33 |
34 | #if canImport(Darwin)
35 | extension NMBObjCMatcher {
36 | @objc public class func beLessThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBMatcher {
37 | return NMBPredicate { actualExpression in
38 | let expr = actualExpression.cast { $0 as? NMBComparable }
39 | return try beLessThanOrEqualTo(expected).satisfies(expr).toObjectiveC()
40 | }
41 | }
42 | }
43 | #endif
44 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeNil.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is nil.
4 | public func beNil() -> Predicate {
5 | return Predicate.simpleNilable("be nil") { actualExpression in
6 | let actualValue = try actualExpression.evaluate()
7 | return PredicateStatus(bool: actualValue == nil)
8 | }
9 | }
10 |
11 | #if canImport(Darwin)
12 | extension NMBObjCMatcher {
13 | @objc public class func beNilMatcher() -> NMBMatcher {
14 | return NMBPredicate { actualExpression in
15 | return try beNil().satisfies(actualExpression).toObjectiveC()
16 | }
17 | }
18 | }
19 | #endif
20 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeVoid.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value is Void.
4 | public func beVoid() -> Predicate<()> {
5 | return Predicate.simpleNilable("be void") { actualExpression in
6 | let actualValue: ()? = try actualExpression.evaluate()
7 | return PredicateStatus(bool: actualValue != nil)
8 | }
9 | }
10 |
11 | extension Expectation where T == () {
12 | public static func == (lhs: Expectation<()>, rhs: ()) {
13 | lhs.to(beVoid())
14 | }
15 |
16 | public static func != (lhs: Expectation<()>, rhs: ()) {
17 | lhs.toNot(beVoid())
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/BeginWith.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual sequence's first element
4 | /// is equal to the expected value.
5 | public func beginWith(_ startingElement: T) -> Predicate
6 | where S.Iterator.Element == T {
7 | return Predicate.simple("begin with <\(startingElement)>") { actualExpression in
8 | if let actualValue = try actualExpression.evaluate() {
9 | var actualGenerator = actualValue.makeIterator()
10 | return PredicateStatus(bool: actualGenerator.next() == startingElement)
11 | }
12 | return .fail
13 | }
14 | }
15 |
16 | /// A Nimble matcher that succeeds when the actual collection's first element
17 | /// is equal to the expected object.
18 | public func beginWith(_ startingElement: Any) -> Predicate {
19 | return Predicate.simple("begin with <\(startingElement)>") { actualExpression in
20 | guard let collection = try actualExpression.evaluate() else { return .fail }
21 | guard collection.count > 0 else { return .doesNotMatch }
22 | #if os(Linux)
23 | guard let collectionValue = collection.object(at: 0) as? NSObject else {
24 | return .fail
25 | }
26 | #else
27 | let collectionValue = collection.object(at: 0) as AnyObject
28 | #endif
29 | return PredicateStatus(bool: collectionValue.isEqual(startingElement))
30 | }
31 | }
32 |
33 | /// A Nimble matcher that succeeds when the actual string contains expected substring
34 | /// where the expected substring's location is zero.
35 | public func beginWith(_ startingSubstring: String) -> Predicate {
36 | return Predicate.simple("begin with <\(startingSubstring)>") { actualExpression in
37 | if let actual = try actualExpression.evaluate() {
38 | return PredicateStatus(bool: actual.hasPrefix(startingSubstring))
39 | }
40 | return .fail
41 | }
42 | }
43 |
44 | #if canImport(Darwin)
45 | extension NMBObjCMatcher {
46 | @objc public class func beginWithMatcher(_ expected: Any) -> NMBMatcher {
47 | return NMBPredicate { actualExpression in
48 | let actual = try actualExpression.evaluate()
49 | if actual is String {
50 | let expr = actualExpression.cast { $0 as? String }
51 | // swiftlint:disable:next force_cast
52 | return try beginWith(expected as! String).satisfies(expr).toObjectiveC()
53 | } else {
54 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection }
55 | return try beginWith(expected).satisfies(expr).toObjectiveC()
56 | }
57 | }
58 | }
59 | }
60 | #endif
61 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/ContainElementSatisfying.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | public func containElementSatisfying(_ predicate: @escaping ((T) -> Bool), _ predicateDescription: String = "") -> Predicate where S.Iterator.Element == T {
4 |
5 | return Predicate.define { actualExpression in
6 | let message: ExpectationMessage
7 | if predicateDescription == "" {
8 | message = .expectedTo("find object in collection that satisfies predicate")
9 | } else {
10 | message = .expectedTo("find object in collection \(predicateDescription)")
11 | }
12 |
13 | if let sequence = try actualExpression.evaluate() {
14 | for object in sequence {
15 | if predicate(object) {
16 | return PredicateResult(bool: true, message: message)
17 | }
18 | }
19 |
20 | return PredicateResult(bool: false, message: message)
21 | }
22 |
23 | return PredicateResult(status: .fail, message: message)
24 | }
25 | }
26 |
27 | #if canImport(Darwin)
28 | extension NMBObjCMatcher {
29 | @objc public class func containElementSatisfyingMatcher(_ predicate: @escaping ((NSObject) -> Bool)) -> NMBMatcher {
30 | return NMBPredicate { actualExpression in
31 | let value = try actualExpression.evaluate()
32 | guard let enumeration = value as? NSFastEnumeration else {
33 | let message = ExpectationMessage.fail(
34 | "containElementSatisfying must be provided an NSFastEnumeration object"
35 | )
36 | return NMBPredicateResult(status: .fail, message: message.toObjectiveC())
37 | }
38 |
39 | let message = ExpectationMessage
40 | .expectedTo("find object in collection that satisfies predicate")
41 | .toObjectiveC()
42 |
43 | var iterator = NSFastEnumerationIterator(enumeration)
44 | while let item = iterator.next() {
45 | guard let object = item as? NSObject else {
46 | continue
47 | }
48 |
49 | if predicate(object) {
50 | return NMBPredicateResult(status: .matches, message: message)
51 | }
52 | }
53 |
54 | return NMBPredicateResult(status: .doesNotMatch, message: message)
55 | }
56 | }
57 | }
58 | #endif
59 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/ElementsEqual.swift:
--------------------------------------------------------------------------------
1 | /// A Nimble matcher that succeeds when the actual sequence contain the same elements in the same order to the exepected sequence.
2 | public func elementsEqual(_ expectedValue: S?) -> Predicate where S.Element: Equatable {
3 | // A matcher abstraction for https://developer.apple.com/documentation/swift/sequence/2949668-elementsequal
4 | return Predicate.define("elementsEqual <\(stringify(expectedValue))>") { (actualExpression, msg) in
5 | let actualValue = try actualExpression.evaluate()
6 | switch (expectedValue, actualValue) {
7 | case (nil, _?):
8 | return PredicateResult(status: .fail, message: msg.appendedBeNilHint())
9 | case (nil, nil), (_, nil):
10 | return PredicateResult(status: .fail, message: msg)
11 | case (let expected?, let actual?):
12 | let matches = expected.elementsEqual(actual)
13 | return PredicateResult(bool: matches, message: msg)
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/EndWith.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual sequence's last element
4 | /// is equal to the expected value.
5 | public func endWith(_ endingElement: T) -> Predicate
6 | where S.Iterator.Element == T {
7 | return Predicate.simple("end with <\(endingElement)>") { actualExpression in
8 | if let actualValue = try actualExpression.evaluate() {
9 | var actualGenerator = actualValue.makeIterator()
10 | var lastItem: T?
11 | var item: T?
12 | repeat {
13 | lastItem = item
14 | item = actualGenerator.next()
15 | } while(item != nil)
16 |
17 | return PredicateStatus(bool: lastItem == endingElement)
18 | }
19 | return .fail
20 | }
21 | }
22 |
23 | /// A Nimble matcher that succeeds when the actual collection's last element
24 | /// is equal to the expected object.
25 | public func endWith(_ endingElement: Any) -> Predicate {
26 | return Predicate.simple("end with <\(endingElement)>") { actualExpression in
27 | guard let collection = try actualExpression.evaluate() else { return .fail }
28 | guard collection.count > 0 else { return PredicateStatus(bool: false) }
29 | #if os(Linux)
30 | guard let collectionValue = collection.object(at: collection.count - 1) as? NSObject else {
31 | return .fail
32 | }
33 | #else
34 | let collectionValue = collection.object(at: collection.count - 1) as AnyObject
35 | #endif
36 |
37 | return PredicateStatus(bool: collectionValue.isEqual(endingElement))
38 | }
39 | }
40 |
41 | /// A Nimble matcher that succeeds when the actual string contains the expected substring
42 | /// where the expected substring's location is the actual string's length minus the
43 | /// expected substring's length.
44 | public func endWith(_ endingSubstring: String) -> Predicate {
45 | return Predicate.simple("end with <\(endingSubstring)>") { actualExpression in
46 | if let collection = try actualExpression.evaluate() {
47 | return PredicateStatus(bool: collection.hasSuffix(endingSubstring))
48 | }
49 | return .fail
50 | }
51 | }
52 |
53 | #if canImport(Darwin)
54 | extension NMBObjCMatcher {
55 | @objc public class func endWithMatcher(_ expected: Any) -> NMBMatcher {
56 | return NMBPredicate { actualExpression in
57 | let actual = try actualExpression.evaluate()
58 | if actual is String {
59 | let expr = actualExpression.cast { $0 as? String }
60 | // swiftlint:disable:next force_cast
61 | return try endWith(expected as! String).satisfies(expr).toObjectiveC()
62 | } else {
63 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection }
64 | return try endWith(expected).satisfies(expr).toObjectiveC()
65 | }
66 | }
67 | }
68 | }
69 | #endif
70 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/HaveCount.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // The `haveCount` matchers do not print the full string representation of the collection value,
4 | // instead they only print the type name and the expected count. This makes it easier to understand
5 | // the reason for failed expectations. See: https://github.com/Quick/Nimble/issues/308.
6 | // The representation of the collection content is provided in a new line as an `extendedMessage`.
7 |
8 | /// A Nimble matcher that succeeds when the actual Collection's count equals
9 | /// the expected value
10 | public func haveCount(_ expectedValue: Int) -> Predicate {
11 | return Predicate.define { actualExpression in
12 | if let actualValue = try actualExpression.evaluate() {
13 | let message = ExpectationMessage
14 | .expectedCustomValueTo(
15 | "have \(prettyCollectionType(actualValue)) with count \(stringify(expectedValue))",
16 | "\(actualValue.count)"
17 | )
18 | .appended(details: "Actual Value: \(stringify(actualValue))")
19 |
20 | let result = expectedValue == actualValue.count
21 | return PredicateResult(bool: result, message: message)
22 | } else {
23 | return PredicateResult(status: .fail, message: .fail(""))
24 | }
25 | }
26 | }
27 |
28 | /// A Nimble matcher that succeeds when the actual collection's count equals
29 | /// the expected value
30 | public func haveCount(_ expectedValue: Int) -> Predicate {
31 | return Predicate { actualExpression in
32 | if let actualValue = try actualExpression.evaluate() {
33 | let message = ExpectationMessage
34 | .expectedCustomValueTo(
35 | "have \(prettyCollectionType(actualValue)) with count \(stringify(expectedValue))",
36 | "\(actualValue.count)"
37 | )
38 | .appended(details: "Actual Value: \(stringify(actualValue))")
39 |
40 | let result = expectedValue == actualValue.count
41 | return PredicateResult(bool: result, message: message)
42 | } else {
43 | return PredicateResult(status: .fail, message: .fail(""))
44 | }
45 | }
46 | }
47 |
48 | #if canImport(Darwin)
49 | extension NMBObjCMatcher {
50 | @objc public class func haveCountMatcher(_ expected: NSNumber) -> NMBMatcher {
51 | return NMBPredicate { actualExpression in
52 | let location = actualExpression.location
53 | let actualValue = try actualExpression.evaluate()
54 | if let value = actualValue as? NMBCollection {
55 | let expr = Expression(expression: ({ value as NMBCollection}), location: location)
56 | return try haveCount(expected.intValue).satisfies(expr).toObjectiveC()
57 | }
58 |
59 | let message: ExpectationMessage
60 | if let actualValue = actualValue {
61 | message = ExpectationMessage.expectedCustomValueTo(
62 | "get type of NSArray, NSSet, NSDictionary, or NSHashTable",
63 | "\(String(describing: type(of: actualValue)))"
64 | )
65 | } else {
66 | message = ExpectationMessage
67 | .expectedActualValueTo("have a collection with count \(stringify(expected.intValue))")
68 | .appendedBeNilHint()
69 | }
70 | return NMBPredicateResult(status: .fail, message: message.toObjectiveC())
71 | }
72 | }
73 | }
74 | #endif
75 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/Match.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual string satisfies the regular expression
4 | /// described by the expected string.
5 | public func match(_ expectedValue: String?) -> Predicate {
6 | return Predicate.simple("match <\(stringify(expectedValue))>") { actualExpression in
7 | if let actual = try actualExpression.evaluate() {
8 | if let regexp = expectedValue {
9 | let bool = actual.range(of: regexp, options: .regularExpression) != nil
10 | return PredicateStatus(bool: bool)
11 | }
12 | }
13 |
14 | return .fail
15 | }
16 | }
17 |
18 | #if canImport(Darwin)
19 |
20 | extension NMBObjCMatcher {
21 | @objc public class func matchMatcher(_ expected: NSString) -> NMBMatcher {
22 | return NMBPredicate { actualExpression in
23 | let actual = actualExpression.cast { $0 as? String }
24 | return try match(expected.description).satisfies(actual).toObjectiveC()
25 | }
26 | }
27 | }
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/MatchError.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual expression evaluates to an
4 | /// error from the specified case.
5 | ///
6 | /// Errors are tried to be compared by their implementation of Equatable,
7 | /// otherwise they fallback to comparison by _domain and _code.
8 | public func matchError(_ error: T) -> Predicate {
9 | return Predicate.define { actualExpression in
10 | let actualError = try actualExpression.evaluate()
11 |
12 | let failureMessage = FailureMessage()
13 | setFailureMessageForError(
14 | failureMessage,
15 | postfixMessageVerb: "match",
16 | actualError: actualError,
17 | error: error
18 | )
19 |
20 | var matches = false
21 | if let actualError = actualError, errorMatchesExpectedError(actualError, expectedError: error) {
22 | matches = true
23 | }
24 |
25 | return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage())
26 | }
27 | }
28 |
29 | /// A Nimble matcher that succeeds when the actual expression evaluates to an
30 | /// error from the specified case.
31 | ///
32 | /// Errors are tried to be compared by their implementation of Equatable,
33 | /// otherwise they fallback to comparision by _domain and _code.
34 | public func matchError(_ error: T) -> Predicate {
35 | return Predicate.define { actualExpression in
36 | let actualError = try actualExpression.evaluate()
37 |
38 | let failureMessage = FailureMessage()
39 | setFailureMessageForError(
40 | failureMessage,
41 | postfixMessageVerb: "match",
42 | actualError: actualError,
43 | error: error
44 | )
45 |
46 | var matches = false
47 | if let actualError = actualError as? T, error == actualError {
48 | matches = true
49 | }
50 |
51 | return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage())
52 | }
53 | }
54 |
55 | /// A Nimble matcher that succeeds when the actual expression evaluates to an
56 | /// error of the specified type
57 | public func matchError(_ errorType: T.Type) -> Predicate {
58 | return Predicate.define { actualExpression in
59 | let actualError = try actualExpression.evaluate()
60 |
61 | let failureMessage = FailureMessage()
62 | setFailureMessageForError(
63 | failureMessage,
64 | postfixMessageVerb: "match",
65 | actualError: actualError,
66 | errorType: errorType
67 | )
68 |
69 | var matches = false
70 | if actualError as? T != nil {
71 | matches = true
72 | }
73 |
74 | return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage())
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/MatcherFunc.swift:
--------------------------------------------------------------------------------
1 | /// DEPRECATED: A convenience API to build matchers that don't need special negation
2 | /// behavior. The toNot() behavior is the negation of to().
3 | ///
4 | /// @see NonNilMatcherFunc if you prefer to have this matcher fail when nil
5 | /// values are received in an expectation.
6 | ///
7 | /// You may use this when implementing your own custom matchers.
8 | ///
9 | /// Use the Matcher protocol instead of this type to accept custom matchers as
10 | /// input parameters.
11 | /// @see allPass for an example that uses accepts other matchers as input.
12 | @available(*, deprecated, message: "Use to Predicate instead")
13 | public struct MatcherFunc: Matcher {
14 | public let matcher: (Expression, FailureMessage) throws -> Bool
15 |
16 | public init(_ matcher: @escaping (Expression, FailureMessage) throws -> Bool) {
17 | self.matcher = matcher
18 | }
19 |
20 | public func matches(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool {
21 | return try matcher(actualExpression, failureMessage)
22 | }
23 |
24 | public func doesNotMatch(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool {
25 | return try !matcher(actualExpression, failureMessage)
26 | }
27 |
28 | /// Compatibility layer to new Matcher API. Converts an old-style matcher to a new one.
29 | /// Note: You should definitely spend the time to convert to the new api as soon as possible
30 | /// since this struct type is deprecated.
31 | public var predicate: Predicate {
32 | return Predicate.fromDeprecatedMatcher(self)
33 | }
34 | }
35 |
36 | /// DEPRECATED: A convenience API to build matchers that don't need special negation
37 | /// behavior. The toNot() behavior is the negation of to().
38 | ///
39 | /// Unlike MatcherFunc, this will always fail if an expectation contains nil.
40 | /// This applies regardless of using to() or toNot().
41 | ///
42 | /// You may use this when implementing your own custom matchers.
43 | ///
44 | /// Use the Matcher protocol instead of this type to accept custom matchers as
45 | /// input parameters.
46 | /// @see allPass for an example that uses accepts other matchers as input.
47 | @available(*, deprecated, message: "Use to Predicate instead")
48 | public struct NonNilMatcherFunc: Matcher {
49 | public let matcher: (Expression, FailureMessage) throws -> Bool
50 |
51 | public init(_ matcher: @escaping (Expression, FailureMessage) throws -> Bool) {
52 | self.matcher = matcher
53 | }
54 |
55 | public func matches(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool {
56 | let pass = try matcher(actualExpression, failureMessage)
57 | if try attachNilErrorIfNeeded(actualExpression, failureMessage: failureMessage) {
58 | return false
59 | }
60 | return pass
61 | }
62 |
63 | public func doesNotMatch(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool {
64 | let pass = try !matcher(actualExpression, failureMessage)
65 | if try attachNilErrorIfNeeded(actualExpression, failureMessage: failureMessage) {
66 | return false
67 | }
68 | return pass
69 | }
70 |
71 | internal func attachNilErrorIfNeeded(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool {
72 | if try actualExpression.evaluate() == nil {
73 | failureMessage.postfixActual = " (use beNil() to match nils)"
74 | return true
75 | }
76 | return false
77 | }
78 |
79 | /// Compatibility layer to new Matcher API. Converts an old-style matcher to a new one.
80 | /// Note: You should definitely spend the time to convert to the new api as soon as possible
81 | /// since this struct type is deprecated.
82 | public var predicate: Predicate {
83 | return Predicate.fromDeprecatedMatcher(self)
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/PostNotification.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal class NotificationCollector {
4 | private(set) var observedNotifications: [Notification]
5 | private let notificationCenter: NotificationCenter
6 | private var token: NSObjectProtocol?
7 |
8 | required init(notificationCenter: NotificationCenter) {
9 | self.notificationCenter = notificationCenter
10 | self.observedNotifications = []
11 | }
12 |
13 | func startObserving() {
14 | // swiftlint:disable:next line_length
15 | self.token = self.notificationCenter.addObserver(forName: nil, object: nil, queue: nil) { [weak self] notification in
16 | // linux-swift gets confused by .append(n)
17 | self?.observedNotifications.append(notification)
18 | }
19 | }
20 |
21 | deinit {
22 | if let token = self.token {
23 | self.notificationCenter.removeObserver(token)
24 | }
25 | }
26 | }
27 |
28 | private let mainThread = pthread_self()
29 |
30 | public func postNotifications(
31 | _ predicate: Predicate<[Notification]>,
32 | from center: NotificationCenter = .default
33 | ) -> Predicate {
34 | _ = mainThread // Force lazy-loading of this value
35 | let collector = NotificationCollector(notificationCenter: center)
36 | collector.startObserving()
37 | var once: Bool = false
38 |
39 | return Predicate { actualExpression in
40 | let collectorNotificationsExpression = Expression(
41 | memoizedExpression: { _ in
42 | return collector.observedNotifications
43 | },
44 | location: actualExpression.location,
45 | withoutCaching: true
46 | )
47 |
48 | assert(pthread_equal(mainThread, pthread_self()) != 0, "Only expecting closure to be evaluated on main thread.")
49 | if !once {
50 | once = true
51 | _ = try actualExpression.evaluate()
52 | }
53 |
54 | let actualValue: String
55 | if collector.observedNotifications.isEmpty {
56 | actualValue = "no notifications"
57 | } else {
58 | actualValue = "<\(stringify(collector.observedNotifications))>"
59 | }
60 |
61 | var result = try predicate.satisfies(collectorNotificationsExpression)
62 | result.message = result.message.replacedExpectation { message in
63 | return .expectedCustomValueTo(message.expectedMessage, actualValue)
64 | }
65 | return result
66 | }
67 | }
68 |
69 | @available(*, deprecated, renamed: "postNotifications(_:from:)")
70 | public func postNotifications(
71 | _ predicate: Predicate<[Notification]>,
72 | fromNotificationCenter center: NotificationCenter
73 | ) -> Predicate {
74 | return postNotifications(predicate, from: center)
75 | }
76 |
77 | public func postNotifications(
78 | _ notificationsMatcher: T,
79 | from center: NotificationCenter = .default
80 | )-> Predicate where T: Matcher, T.ValueType == [Notification] {
81 | _ = mainThread // Force lazy-loading of this value
82 | let collector = NotificationCollector(notificationCenter: center)
83 | collector.startObserving()
84 | var once: Bool = false
85 |
86 | return Predicate { actualExpression in
87 | let collectorNotificationsExpression = Expression(memoizedExpression: { _ in
88 | return collector.observedNotifications
89 | }, location: actualExpression.location, withoutCaching: true)
90 |
91 | assert(pthread_equal(mainThread, pthread_self()) != 0, "Only expecting closure to be evaluated on main thread.")
92 | if !once {
93 | once = true
94 | _ = try actualExpression.evaluate()
95 | }
96 |
97 | let failureMessage = FailureMessage()
98 | let match = try notificationsMatcher.matches(collectorNotificationsExpression, failureMessage: failureMessage)
99 | if collector.observedNotifications.isEmpty {
100 | failureMessage.actualValue = "no notifications"
101 | } else {
102 | failureMessage.actualValue = "<\(stringify(collector.observedNotifications))>"
103 | }
104 | return PredicateResult(bool: match, message: failureMessage.toExpectationMessage())
105 | }
106 | }
107 |
108 | @available(*, deprecated, renamed: "postNotifications(_:from:)")
109 | public func postNotifications(
110 | _ notificationsMatcher: T,
111 | fromNotificationCenter center: NotificationCenter
112 | )-> Predicate where T: Matcher, T.ValueType == [Notification] {
113 | return postNotifications(notificationsMatcher, from: center)
114 | }
115 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/SatisfyAllOf.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value matches with all of the matchers
4 | /// provided in the variable list of matchers.
5 | public func satisfyAllOf(_ predicates: Predicate...) -> Predicate {
6 | return satisfyAllOf(predicates)
7 | }
8 |
9 | /// A Nimble matcher that succeeds when the actual value matches with all of the matchers
10 | /// provided in the variable list of matchers.
11 | public func satisfyAllOf(_ matchers: U...) -> Predicate
12 | where U: Matcher, U.ValueType == T {
13 | return satisfyAllOf(matchers.map { $0.predicate })
14 | }
15 |
16 | internal func satisfyAllOf(_ predicates: [Predicate]) -> Predicate {
17 | return Predicate.define { actualExpression in
18 | var postfixMessages = [String]()
19 | var matches = true
20 | for predicate in predicates {
21 | let result = try predicate.satisfies(actualExpression)
22 | if result.toBoolean(expectation: .toNotMatch) {
23 | matches = false
24 | }
25 | postfixMessages.append("{\(result.message.expectedMessage)}")
26 | }
27 |
28 | var msg: ExpectationMessage
29 | if let actualValue = try actualExpression.evaluate() {
30 | msg = .expectedCustomValueTo(
31 | "match all of: " + postfixMessages.joined(separator: ", and "),
32 | "\(actualValue)"
33 | )
34 | } else {
35 | msg = .expectedActualValueTo(
36 | "match all of: " + postfixMessages.joined(separator: ", and ")
37 | )
38 | }
39 |
40 | return PredicateResult(bool: matches, message: msg)
41 | }
42 | }
43 |
44 | public func && (left: Predicate, right: Predicate) -> Predicate {
45 | return satisfyAllOf(left, right)
46 | }
47 |
48 | #if canImport(Darwin)
49 | extension NMBObjCMatcher {
50 | @objc public class func satisfyAllOfMatcher(_ matchers: [NMBMatcher]) -> NMBPredicate {
51 | return NMBPredicate { actualExpression in
52 | if matchers.isEmpty {
53 | return NMBPredicateResult(
54 | status: NMBPredicateStatus.fail,
55 | message: NMBExpectationMessage(
56 | fail: "satisfyAllOf must be called with at least one matcher"
57 | )
58 | )
59 | }
60 |
61 | var elementEvaluators = [Predicate]()
62 | for matcher in matchers {
63 | let elementEvaluator = Predicate { expression in
64 | if let predicate = matcher as? NMBPredicate {
65 | // swiftlint:disable:next line_length
66 | return predicate.satisfies({ try expression.evaluate() }, location: actualExpression.location).toSwift()
67 | } else {
68 | let failureMessage = FailureMessage()
69 | let success = matcher.matches(
70 | // swiftlint:disable:next force_try
71 | { try! expression.evaluate() },
72 | failureMessage: failureMessage,
73 | location: actualExpression.location
74 | )
75 | return PredicateResult(bool: success, message: failureMessage.toExpectationMessage())
76 | }
77 | }
78 |
79 | elementEvaluators.append(elementEvaluator)
80 | }
81 |
82 | return try satisfyAllOf(elementEvaluators).satisfies(actualExpression).toObjectiveC()
83 | }
84 | }
85 | }
86 | #endif
87 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/SatisfyAnyOf.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// A Nimble matcher that succeeds when the actual value matches with any of the matchers
4 | /// provided in the variable list of matchers.
5 | public func satisfyAnyOf(_ predicates: Predicate...) -> Predicate {
6 | return satisfyAnyOf(predicates)
7 | }
8 |
9 | /// A Nimble matcher that succeeds when the actual value matches with any of the matchers
10 | /// provided in the variable list of matchers.
11 | public func satisfyAnyOf(_ matchers: U...) -> Predicate
12 | where U: Matcher, U.ValueType == T {
13 | return satisfyAnyOf(matchers.map { $0.predicate })
14 | }
15 |
16 | internal func satisfyAnyOf(_ predicates: [Predicate]) -> Predicate {
17 | return Predicate.define { actualExpression in
18 | var postfixMessages = [String]()
19 | var matches = false
20 | for predicate in predicates {
21 | let result = try predicate.satisfies(actualExpression)
22 | if result.toBoolean(expectation: .toMatch) {
23 | matches = true
24 | }
25 | postfixMessages.append("{\(result.message.expectedMessage)}")
26 | }
27 |
28 | var msg: ExpectationMessage
29 | if let actualValue = try actualExpression.evaluate() {
30 | msg = .expectedCustomValueTo(
31 | "match one of: " + postfixMessages.joined(separator: ", or "),
32 | "\(actualValue)"
33 | )
34 | } else {
35 | msg = .expectedActualValueTo(
36 | "match one of: " + postfixMessages.joined(separator: ", or ")
37 | )
38 | }
39 |
40 | return PredicateResult(bool: matches, message: msg)
41 | }
42 | }
43 |
44 | public func || (left: Predicate, right: Predicate) -> Predicate {
45 | return satisfyAnyOf(left, right)
46 | }
47 |
48 | public func || (left: NonNilMatcherFunc, right: NonNilMatcherFunc) -> Predicate {
49 | return satisfyAnyOf(left, right)
50 | }
51 |
52 | public func || (left: MatcherFunc, right: MatcherFunc) -> Predicate {
53 | return satisfyAnyOf(left, right)
54 | }
55 |
56 | #if canImport(Darwin)
57 | extension NMBObjCMatcher {
58 | @objc public class func satisfyAnyOfMatcher(_ matchers: [NMBMatcher]) -> NMBPredicate {
59 | return NMBPredicate { actualExpression in
60 | if matchers.isEmpty {
61 | return NMBPredicateResult(
62 | status: NMBPredicateStatus.fail,
63 | message: NMBExpectationMessage(
64 | fail: "satisfyAnyOf must be called with at least one matcher"
65 | )
66 | )
67 | }
68 |
69 | var elementEvaluators = [Predicate]()
70 | for matcher in matchers {
71 | let elementEvaluator = Predicate { expression in
72 | if let predicate = matcher as? NMBPredicate {
73 | // swiftlint:disable:next line_length
74 | return predicate.satisfies({ try expression.evaluate() }, location: actualExpression.location).toSwift()
75 | } else {
76 | let failureMessage = FailureMessage()
77 | let success = matcher.matches(
78 | // swiftlint:disable:next force_try
79 | { try! expression.evaluate() },
80 | failureMessage: failureMessage,
81 | location: actualExpression.location
82 | )
83 | return PredicateResult(bool: success, message: failureMessage.toExpectationMessage())
84 | }
85 | }
86 |
87 | elementEvaluators.append(elementEvaluator)
88 | }
89 |
90 | return try satisfyAnyOf(elementEvaluators).satisfies(actualExpression).toObjectiveC()
91 | }
92 | }
93 | }
94 | #endif
95 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/ThrowAssertion.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if canImport(NimbleCwlPreconditionTesting)
4 | import NimbleCwlPreconditionTesting
5 | #endif
6 |
7 | public func throwAssertion() -> Predicate {
8 | return Predicate { actualExpression in
9 | #if arch(x86_64) && canImport(Darwin)
10 | let message = ExpectationMessage.expectedTo("throw an assertion")
11 |
12 | var actualError: Error?
13 | let caughtException: BadInstructionException? = catchBadInstruction {
14 | #if os(tvOS)
15 | if !NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning {
16 | print()
17 | print("[Nimble Warning]: If you're getting stuck on a debugger breakpoint for a " +
18 | "fatal error while using throwAssertion(), please disable 'Debug Executable' " +
19 | "in your scheme. Go to 'Edit Scheme > Test > Info' and uncheck " +
20 | "'Debug Executable'. If you've already done that, suppress this warning " +
21 | "by setting `NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true`. " +
22 | "This is required because the standard methods of catching assertions " +
23 | "(mach APIs) are unavailable for tvOS. Instead, the same mechanism the " +
24 | "debugger uses is the fallback method for tvOS."
25 | )
26 | print()
27 | NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true
28 | }
29 | #endif
30 | do {
31 | try actualExpression.evaluate()
32 | } catch {
33 | actualError = error
34 | }
35 | }
36 |
37 | if let actualError = actualError {
38 | return PredicateResult(
39 | bool: false,
40 | message: message.appended(message: "; threw error instead <\(actualError)>")
41 | )
42 | } else {
43 | return PredicateResult(bool: caughtException != nil, message: message)
44 | }
45 | #else
46 | fatalError("The throwAssertion Nimble matcher can only run on x86_64 platforms with " +
47 | "Objective-C (e.g. macOS, iPhone 5s or later simulators). You can silence this error " +
48 | "by placing the test case inside an #if arch(x86_64) or canImport(Darwin) conditional statement")
49 | #endif
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Matchers/ToSucceed.swift:
--------------------------------------------------------------------------------
1 | /**
2 | Used by the `toSucceed` matcher.
3 |
4 | This is the return type for the closure.
5 | */
6 | public enum ToSucceedResult {
7 | case succeeded
8 | case failed(reason: String)
9 | }
10 |
11 | /**
12 | A Nimble matcher that takes in a closure for validation.
13 |
14 | Return `.succeeded` when the validation succeeds.
15 | Return `.failed` with a failure reason when the validation fails.
16 | */
17 | public func succeed() -> Predicate<() -> ToSucceedResult> {
18 | return Predicate.define { actualExpression in
19 | let optActual = try actualExpression.evaluate()
20 | guard let actual = optActual else {
21 | return PredicateResult(status: .fail, message: .fail("expected a closure, got "))
22 | }
23 |
24 | switch actual() {
25 | case .succeeded:
26 | return PredicateResult(
27 | bool: true,
28 | message: .expectedCustomValueTo("succeed", "")
29 | )
30 | case .failed(let reason):
31 | return PredicateResult(
32 | bool: false,
33 | message: .expectedCustomValueTo("succeed", " because <\(reason)>")
34 | )
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Nimble.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "NMBExceptionCapture.h"
3 | #import "NMBStringify.h"
4 | #import "DSL.h"
5 |
6 | #import "CwlPreconditionTesting.h"
7 |
8 | FOUNDATION_EXPORT double NimbleVersionNumber;
9 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
10 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Utils/Errors.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // Generic
4 |
5 | internal func setFailureMessageForError(
6 | _ failureMessage: FailureMessage,
7 | postfixMessageVerb: String = "throw",
8 | actualError: Error?,
9 | error: T? = nil,
10 | errorType: T.Type? = nil,
11 | closure: ((T) -> Void)? = nil) {
12 | failureMessage.postfixMessage = "\(postfixMessageVerb) error"
13 |
14 | if let error = error {
15 | failureMessage.postfixMessage += " <\(error)>"
16 | } else if errorType != nil || closure != nil {
17 | failureMessage.postfixMessage += " from type <\(T.self)>"
18 | }
19 | if closure != nil {
20 | failureMessage.postfixMessage += " that satisfies block"
21 | }
22 | if error == nil && errorType == nil && closure == nil {
23 | failureMessage.postfixMessage = "\(postfixMessageVerb) any error"
24 | }
25 |
26 | if let actualError = actualError {
27 | failureMessage.actualValue = "<\(actualError)>"
28 | } else {
29 | failureMessage.actualValue = "no error"
30 | }
31 | }
32 |
33 | internal func errorMatchesExpectedError(
34 | _ actualError: Error,
35 | expectedError: T) -> Bool {
36 | return actualError._domain == expectedError._domain
37 | && actualError._code == expectedError._code
38 | }
39 |
40 | // Non-generic
41 |
42 | internal func setFailureMessageForError(
43 | _ failureMessage: FailureMessage,
44 | actualError: Error?,
45 | closure: ((Error) -> Void)?) {
46 | failureMessage.postfixMessage = "throw error"
47 |
48 | if closure != nil {
49 | failureMessage.postfixMessage += " that satisfies block"
50 | } else {
51 | failureMessage.postfixMessage = "throw any error"
52 | }
53 |
54 | if let actualError = actualError {
55 | failureMessage.actualValue = "<\(actualError)>"
56 | } else {
57 | failureMessage.actualValue = "no error"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Utils/Functional.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if !swift(>=4.2)
4 | extension Sequence {
5 | internal func allSatisfy(_ predicate: (Element) throws -> Bool) rethrows -> Bool {
6 | for item in self {
7 | if try !predicate(item) {
8 | return false
9 | }
10 | }
11 | return true
12 | }
13 | }
14 | #endif
15 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/Nimble/Utils/SourceLocation.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // Ideally we would always use `StaticString` as the type for tracking the file name
4 | // that expectations originate from, for consistency with `assert` etc. from the
5 | // stdlib, and because recent versions of the XCTest overlay require `StaticString`
6 | // when calling `XCTFail`. Under the Objective-C runtime (i.e. building on Mac), we
7 | // have to use `String` instead because StaticString can't be generated from Objective-C
8 | #if SWIFT_PACKAGE
9 | public typealias FileString = StaticString
10 | #else
11 | public typealias FileString = String
12 | #endif
13 |
14 | public final class SourceLocation: NSObject {
15 | public let file: FileString
16 | public let line: UInt
17 |
18 | override init() {
19 | file = "Unknown File"
20 | line = 0
21 | }
22 |
23 | init(file: FileString, line: UInt) {
24 | self.file = file
25 | self.line = line
26 | }
27 |
28 | override public var description: String {
29 | return "\(file):\(line)"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface NMBExceptionCapture : NSObject
5 |
6 | - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))finally;
7 | - (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:));
8 |
9 | @end
10 |
11 | typedef void(^NMBSourceCallbackBlock)(BOOL successful);
12 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.m:
--------------------------------------------------------------------------------
1 | #import "NMBExceptionCapture.h"
2 |
3 | @interface NMBExceptionCapture ()
4 | @property (nonatomic, copy) void(^ _Nullable handler)(NSException * _Nullable);
5 | @property (nonatomic, copy) void(^ _Nullable finally)(void);
6 | @end
7 |
8 | @implementation NMBExceptionCapture
9 |
10 | - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))finally {
11 | self = [super init];
12 | if (self) {
13 | self.handler = handler;
14 | self.finally = finally;
15 | }
16 | return self;
17 | }
18 |
19 | - (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock {
20 | @try {
21 | unsafeBlock();
22 | }
23 | @catch (NSException *exception) {
24 | if (self.handler) {
25 | self.handler(exception);
26 | }
27 | }
28 | @finally {
29 | if (self.finally) {
30 | self.finally();
31 | }
32 | }
33 | }
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.h:
--------------------------------------------------------------------------------
1 | @class NSString;
2 |
3 | /**
4 | * Returns a string appropriate for displaying in test output
5 | * from the provided value.
6 | *
7 | * @param anyObject A value that will show up in a test's output.
8 | *
9 | * @return The string that is returned can be
10 | * customized per type by conforming a type to the `TestOutputStringConvertible`
11 | * protocol. When stringifying a non-`TestOutputStringConvertible` type, this
12 | * function will return the value's debug description and then its
13 | * normal description if available and in that order. Otherwise it
14 | * will return the result of constructing a string from the value.
15 | *
16 | * @see `TestOutputStringConvertible`
17 | */
18 | extern NSString *_Nonnull NMBStringify(id _Nullable anyObject) __attribute__((warn_unused_result));
19 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.m:
--------------------------------------------------------------------------------
1 | #import "NMBStringify.h"
2 |
3 | #if __has_include("Nimble-Swift.h")
4 | #import "Nimble-Swift.h"
5 | #else
6 | #import
7 | #endif
8 |
9 | NSString *_Nonnull NMBStringify(id _Nullable anyObject) {
10 | return [NMBStringer stringify:anyObject];
11 | }
12 |
--------------------------------------------------------------------------------
/Pods/Nimble/Sources/NimbleObjectiveC/XCTestObservationCenter+Register.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #if __has_include("Nimble-Swift.h")
4 | #import "Nimble-Swift.h"
5 | #else
6 | #import
7 | #endif
8 |
9 | __attribute__((constructor))
10 | static void registerCurrentTestCaseTracker(void) {
11 | [[XCTestObservationCenter sharedTestObservationCenter] addTestObserver:[CurrentTestCaseTracker sharedInstance]];
12 | }
13 |
--------------------------------------------------------------------------------
/Pods/Quick/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | [](https://travis-ci.org/Quick/Quick)
4 | [](https://cocoapods.org/pods/Quick)
5 | [](https://github.com/Carthage/Carthage)
6 | [](https://github.com/JamitLabs/Accio)
7 | [](https://cocoapods.org/pods/Quick)
8 |
9 | Quick is a behavior-driven development framework for Swift and Objective-C.
10 | Inspired by [RSpec](https://github.com/rspec/rspec), [Specta](https://github.com/specta/specta), and [Ginkgo](https://github.com/onsi/ginkgo).
11 |
12 | 
13 |
14 | ```swift
15 | // Swift
16 |
17 | import Quick
18 | import Nimble
19 |
20 | class TableOfContentsSpec: QuickSpec {
21 | override func spec() {
22 | describe("the 'Documentation' directory") {
23 | it("has everything you need to get started") {
24 | let sections = Directory("Documentation").sections
25 | expect(sections).to(contain("Organized Tests with Quick Examples and Example Groups"))
26 | expect(sections).to(contain("Installing Quick"))
27 | }
28 |
29 | context("if it doesn't have what you're looking for") {
30 | it("needs to be updated") {
31 | let you = You(awesome: true)
32 | expect{you.submittedAnIssue}.toEventually(beTruthy())
33 | }
34 | }
35 | }
36 | }
37 | }
38 | ```
39 | #### Nimble
40 | Quick comes together with [Nimble](https://github.com/Quick/Nimble) — a matcher framework for your tests. You can learn why `XCTAssert()` statements make your expectations unclear and how to fix that using Nimble assertions [here](./Documentation/en-us/NimbleAssertions.md).
41 |
42 | ## Swift Version
43 |
44 | Certain versions of Quick and Nimble only support certain versions of Swift. Depending on which version of Swift your project uses, you should use specific versions of Quick and Nimble. Use the table below to determine which versions of Quick and Nimble are compatible with your project.
45 |
46 | |Swift version |Quick version |Nimble version |
47 | |:--------------------|:---------------|:--------------|
48 | |Swift 5.2 |v3.0.0 or later |v9.0.0 or later|
49 | |Swift 4.2 / Swift 5 |v1.3.2 or later |v7.3.2 or later|
50 | |Swift 3 / Swift 4 |v1.0.0 or later |v5.0.0 or later|
51 | |Swift 2.2 / Swift 2.3|v0.9.3 |v4.1.0 |
52 |
53 | ## Documentation
54 |
55 | All documentation can be found in the [Documentation folder](./Documentation), including [detailed installation instructions](./Documentation/en-us/InstallingQuick.md) for CocoaPods, Carthage, Git submodules, and more. For example, you can install Quick and [Nimble](https://github.com/Quick/Nimble) using CocoaPods by adding the following to your Podfile:
56 |
57 | ```rb
58 | # Podfile
59 |
60 | use_frameworks!
61 |
62 | target "MyApp" do
63 | # Normal libraries
64 |
65 | abstract_target 'Tests' do
66 | inherit! :search_paths
67 | target "MyAppTests"
68 | target "MyAppUITests"
69 |
70 | pod 'Quick'
71 | pod 'Nimble'
72 | end
73 | end
74 | ```
75 |
76 | ## Projects using Quick
77 |
78 | Over ten-thousand apps use either Quick and Nimble however, as they are not included in the app binary, neither appear in “Top Used Libraries” blog posts. Therefore, it would be greatly appreciated to remind contributors that their efforts are valued by compiling a list of organizations and projects that use them.
79 |
80 | Does your organization or project use Quick and Nimble? If yes, [please add your project to the list](https://github.com/Quick/Quick/wiki/Projects-using-Quick).
81 |
82 | ## Who uses Quick
83 |
84 | Similar to projects using Quick, it would be nice to hear why people use Quick and Nimble. Are there features you love? Are there features that are just okay? Are there some features we have that no one uses?
85 |
86 | Have something positive to say about Quick (or Nimble)? If yes, [provide a testimonial here](https://github.com/Quick/Quick/wiki/Who-uses-Quick).
87 |
88 |
89 | ## License
90 |
91 | Apache 2.0 license. See the [`LICENSE`](LICENSE) file for details.
92 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Behavior.swift:
--------------------------------------------------------------------------------
1 | /// A `Behavior` encapsulates a set of examples that can be re-used in several locations using the `itBehavesLike`
2 | /// function with a context instance of the generic type.
3 | open class Behavior {
4 |
5 | /**
6 | Override this variable if you want to provide custom name for this example group.
7 | */
8 | open class var name: String { return String(describing: self) }
9 |
10 | /**
11 | Override this method in your behavior to define a set of reusable examples.
12 |
13 | This behaves just like an example group defines using `describe` or `context`--it may contain any number of `beforeEach`
14 | and `afterEach` closures, as well as any number of examples (defined using `it`).
15 |
16 | - parameter aContext: A closure that, when evaluated, returns a `Context` instance that provide the information on the subject.
17 | */
18 | open class func spec(_ aContext: @escaping () -> Context) {}
19 | }
20 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Callsite.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if canImport(Darwin)
4 | // swiftlint:disable type_name
5 | @objcMembers
6 | public class _CallsiteBase: NSObject {}
7 | #else
8 | public class _CallsiteBase: NSObject {}
9 | // swiftlint:enable type_name
10 | #endif
11 |
12 | // Ideally we would always use `StaticString` as the type for tracking the file name
13 | // in which an example is defined, for consistency with `assert` etc. from the
14 | // stdlib, and because recent versions of the XCTest overlay require `StaticString`
15 | // when calling `XCTFail`. Under the Objective-C runtime (i.e. building on macOS), we
16 | // have to use `String` instead because StaticString can't be generated from Objective-C
17 | #if SWIFT_PACKAGE
18 | public typealias FileString = StaticString
19 | #else
20 | public typealias FileString = String
21 | #endif
22 |
23 | /**
24 | An object encapsulating the file and line number at which
25 | a particular example is defined.
26 | */
27 | final public class Callsite: _CallsiteBase {
28 | /**
29 | The absolute path of the file in which an example is defined.
30 | */
31 | public let file: FileString
32 |
33 | /**
34 | The line number on which an example is defined.
35 | */
36 | public let line: UInt
37 |
38 | internal init(file: FileString, line: UInt) {
39 | self.file = file
40 | self.line = line
41 | }
42 | }
43 |
44 | extension Callsite {
45 | /**
46 | Returns a boolean indicating whether two Callsite objects are equal.
47 | If two callsites are in the same file and on the same line, they must be equal.
48 | */
49 | @nonobjc public static func == (lhs: Callsite, rhs: Callsite) -> Bool {
50 | return String(describing: lhs.file) == String(describing: rhs.file) && lhs.line == rhs.line
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Configuration/QuickConfiguration.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import XCTest
3 |
4 | #if SWIFT_PACKAGE
5 |
6 | open class QuickConfiguration: NSObject {
7 | open class func configure(_ configuration: Configuration) {}
8 | }
9 |
10 | #endif
11 |
12 | extension QuickConfiguration {
13 | #if !canImport(Darwin)
14 | private static var configurationSubclasses: [QuickConfiguration.Type] = []
15 | #endif
16 |
17 | /// Finds all direct subclasses of QuickConfiguration and passes them to the block provided.
18 | /// The classes are iterated over in the order that objc_getClassList returns them.
19 | ///
20 | /// - parameter block: A block that takes a QuickConfiguration.Type.
21 | /// This block will be executed once for each subclass of QuickConfiguration.
22 | private static func enumerateSubclasses(_ block: (QuickConfiguration.Type) -> Void) {
23 | #if canImport(Darwin)
24 | let classesCount = objc_getClassList(nil, 0)
25 |
26 | guard classesCount > 0 else {
27 | return
28 | }
29 |
30 | let classes = UnsafeMutablePointer.allocate(capacity: Int(classesCount))
31 | defer { free(classes) }
32 |
33 | objc_getClassList(AutoreleasingUnsafeMutablePointer(classes), classesCount)
34 |
35 | var configurationSubclasses: [QuickConfiguration.Type] = []
36 | for index in 0.. Never {
4 | #if canImport(Darwin)
5 | NSException(name: .internalInconsistencyException, reason: message, userInfo: nil).raise()
6 | #endif
7 |
8 | // This won't be reached when ObjC is available and the exception above is raisd
9 | fatalError(message)
10 | }
11 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Example.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if canImport(Darwin)
4 | // swiftlint:disable type_name
5 | @objcMembers
6 | public class _ExampleBase: NSObject {}
7 | #else
8 | public class _ExampleBase: NSObject {}
9 | // swiftlint:enable type_name
10 | #endif
11 |
12 | /**
13 | Examples, defined with the `it` function, use assertions to
14 | demonstrate how code should behave. These are like "tests" in XCTest.
15 | */
16 | final public class Example: _ExampleBase {
17 | /**
18 | A boolean indicating whether the example is a shared example;
19 | i.e.: whether it is an example defined with `itBehavesLike`.
20 | */
21 | public var isSharedExample = false
22 |
23 | /**
24 | The site at which the example is defined.
25 | This must be set correctly in order for Xcode to highlight
26 | the correct line in red when reporting a failure.
27 | */
28 | public var callsite: Callsite
29 |
30 | weak internal var group: ExampleGroup?
31 |
32 | private let internalDescription: String
33 | private let closure: () throws -> Void
34 | private let flags: FilterFlags
35 |
36 | internal init(description: String, callsite: Callsite, flags: FilterFlags, closure: @escaping () throws -> Void) {
37 | self.internalDescription = description
38 | self.closure = closure
39 | self.callsite = callsite
40 | self.flags = flags
41 | }
42 |
43 | public override var description: String {
44 | return internalDescription
45 | }
46 |
47 | /**
48 | The example name. A name is a concatenation of the name of
49 | the example group the example belongs to, followed by the
50 | description of the example itself.
51 |
52 | The example name is used to generate a test method selector
53 | to be displayed in Xcode's test navigator.
54 | */
55 | public var name: String {
56 | guard let groupName = group?.name else { return description }
57 | return "\(groupName), \(description)"
58 | }
59 |
60 | /**
61 | Executes the example closure, as well as all before and after
62 | closures defined in the its surrounding example groups.
63 | */
64 | public func run() {
65 | let world = World.sharedWorld
66 |
67 | if world.numberOfExamplesRun == 0 {
68 | world.suiteHooks.executeBefores()
69 | }
70 |
71 | let exampleMetadata = ExampleMetadata(example: self, exampleIndex: world.numberOfExamplesRun)
72 | world.currentExampleMetadata = exampleMetadata
73 | defer {
74 | world.currentExampleMetadata = nil
75 | }
76 |
77 | world.exampleHooks.executeBefores(exampleMetadata)
78 | group!.phase = .beforesExecuting
79 | for before in group!.befores {
80 | before(exampleMetadata)
81 | }
82 | group!.phase = .beforesFinished
83 |
84 | do {
85 | try closure()
86 | } catch {
87 | let description = "Test \(name) threw unexpected error: \(error.localizedDescription)"
88 | #if SWIFT_PACKAGE
89 | let file = callsite.file.description
90 | #else
91 | let file = callsite.file
92 | #endif
93 | QuickSpec.current.recordFailure(
94 | withDescription: description,
95 | inFile: file,
96 | atLine: Int(callsite.line),
97 | expected: false
98 | )
99 | }
100 |
101 | group!.phase = .aftersExecuting
102 | for after in group!.afters {
103 | after(exampleMetadata)
104 | }
105 | group!.phase = .aftersFinished
106 | world.exampleHooks.executeAfters(exampleMetadata)
107 |
108 | world.numberOfExamplesRun += 1
109 |
110 | if !world.isRunningAdditionalSuites && world.numberOfExamplesRun >= world.cachedIncludedExampleCount {
111 | world.suiteHooks.executeAfters()
112 | }
113 | }
114 |
115 | /**
116 | Evaluates the filter flags set on this example and on the example groups
117 | this example belongs to. Flags set on the example are trumped by flags on
118 | the example group it belongs to. Flags on inner example groups are trumped
119 | by flags on outer example groups.
120 | */
121 | internal var filterFlags: FilterFlags {
122 | var aggregateFlags = flags
123 | for (key, value) in group!.filterFlags {
124 | aggregateFlags[key] = value
125 | }
126 | return aggregateFlags
127 | }
128 | }
129 |
130 | extension Example {
131 | /**
132 | Returns a boolean indicating whether two Example objects are equal.
133 | If two examples are defined at the exact same callsite, they must be equal.
134 | */
135 | @nonobjc public static func == (lhs: Example, rhs: Example) -> Bool {
136 | return lhs.callsite == rhs.callsite
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/ExampleGroup.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /**
4 | Example groups are logical groupings of examples, defined with
5 | the `describe` and `context` functions. Example groups can share
6 | setup and teardown code.
7 | */
8 | final public class ExampleGroup: NSObject {
9 | weak internal var parent: ExampleGroup?
10 | internal let hooks = ExampleHooks()
11 |
12 | internal var phase: HooksPhase = .nothingExecuted
13 |
14 | private let internalDescription: String
15 | private let flags: FilterFlags
16 | private let isInternalRootExampleGroup: Bool
17 | private var childGroups = [ExampleGroup]()
18 | private var childExamples = [Example]()
19 |
20 | internal init(description: String, flags: FilterFlags, isInternalRootExampleGroup: Bool = false) {
21 | self.internalDescription = description
22 | self.flags = flags
23 | self.isInternalRootExampleGroup = isInternalRootExampleGroup
24 | }
25 |
26 | public override var description: String {
27 | return internalDescription
28 | }
29 |
30 | /**
31 | Returns a list of examples that belong to this example group,
32 | or to any of its descendant example groups.
33 | */
34 | #if canImport(Darwin)
35 | @objc
36 | public var examples: [Example] {
37 | return childExamples + childGroups.flatMap { $0.examples }
38 | }
39 | #else
40 | public var examples: [Example] {
41 | return childExamples + childGroups.flatMap { $0.examples }
42 | }
43 | #endif
44 |
45 | internal var name: String? {
46 | guard let parent = parent else {
47 | return isInternalRootExampleGroup ? nil : description
48 | }
49 |
50 | guard let name = parent.name else { return description }
51 | return "\(name), \(description)"
52 | }
53 |
54 | internal var filterFlags: FilterFlags {
55 | var aggregateFlags = flags
56 | walkUp { group in
57 | for (key, value) in group.flags {
58 | aggregateFlags[key] = value
59 | }
60 | }
61 | return aggregateFlags
62 | }
63 |
64 | internal var befores: [BeforeExampleWithMetadataClosure] {
65 | var closures = Array(hooks.befores.reversed())
66 | walkUp { group in
67 | closures.append(contentsOf: Array(group.hooks.befores.reversed()))
68 | }
69 | return Array(closures.reversed())
70 | }
71 |
72 | internal var afters: [AfterExampleWithMetadataClosure] {
73 | var closures = hooks.afters
74 | walkUp { group in
75 | closures.append(contentsOf: group.hooks.afters)
76 | }
77 | return closures
78 | }
79 |
80 | internal func walkDownExamples(_ callback: (_ example: Example) -> Void) {
81 | for example in childExamples {
82 | callback(example)
83 | }
84 | for group in childGroups {
85 | group.walkDownExamples(callback)
86 | }
87 | }
88 |
89 | internal func appendExampleGroup(_ group: ExampleGroup) {
90 | group.parent = self
91 | childGroups.append(group)
92 | }
93 |
94 | internal func appendExample(_ example: Example) {
95 | example.group = self
96 | childExamples.append(example)
97 | }
98 |
99 | private func walkUp(_ callback: (_ group: ExampleGroup) -> Void) {
100 | var group = self
101 | while let parent = group.parent {
102 | callback(parent)
103 | group = parent
104 | }
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/ExampleMetadata.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if canImport(Darwin)
4 | // swiftlint:disable type_name
5 | @objcMembers
6 | public class _ExampleMetadataBase: NSObject {}
7 | #else
8 | public class _ExampleMetadataBase: NSObject {}
9 | // swiftlint:enable type_name
10 | #endif
11 |
12 | /**
13 | A class that encapsulates information about an example,
14 | including the index at which the example was executed, as
15 | well as the example itself.
16 | */
17 | final public class ExampleMetadata: _ExampleMetadataBase {
18 | /**
19 | The example for which this metadata was collected.
20 | */
21 | public let example: Example
22 |
23 | /**
24 | The index at which this example was executed in the
25 | test suite.
26 | */
27 | public let exampleIndex: Int
28 |
29 | internal init(example: Example, exampleIndex: Int) {
30 | self.example = example
31 | self.exampleIndex = exampleIndex
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Filter.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if canImport(Darwin)
4 | // swiftlint:disable type_name
5 | @objcMembers
6 | public class _FilterBase: NSObject {}
7 | #else
8 | public class _FilterBase: NSObject {}
9 | // swiftlint:enable type_name
10 | #endif
11 |
12 | /**
13 | A mapping of string keys to booleans that can be used to
14 | filter examples or example groups. For example, a "focused"
15 | example would have the flags [Focused: true].
16 | */
17 | public typealias FilterFlags = [String: Bool]
18 |
19 | /**
20 | A namespace for filter flag keys, defined primarily to make the
21 | keys available in Objective-C.
22 | */
23 | final public class Filter: _FilterBase {
24 | /**
25 | Example and example groups with [Focused: true] are included in test runs,
26 | excluding all other examples without this flag. Use this to only run one or
27 | two tests that you're currently focusing on.
28 | */
29 | public class var focused: String {
30 | return "focused"
31 | }
32 |
33 | /**
34 | Example and example groups with [Pending: true] are excluded from test runs.
35 | Use this to temporarily suspend examples that you know do not pass yet.
36 | */
37 | public class var pending: String {
38 | return "pending"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Hooks/Closures.swift:
--------------------------------------------------------------------------------
1 | // MARK: Example Hooks
2 |
3 | /**
4 | A closure executed before an example is run.
5 | */
6 | public typealias BeforeExampleClosure = () -> Void
7 |
8 | /**
9 | A closure executed before an example is run. The closure is given example metadata,
10 | which contains information about the example that is about to be run.
11 | */
12 | public typealias BeforeExampleWithMetadataClosure = (_ exampleMetadata: ExampleMetadata) -> Void
13 |
14 | /**
15 | A closure executed after an example is run.
16 | */
17 | public typealias AfterExampleClosure = BeforeExampleClosure
18 |
19 | /**
20 | A closure executed after an example is run. The closure is given example metadata,
21 | which contains information about the example that has just finished running.
22 | */
23 | public typealias AfterExampleWithMetadataClosure = BeforeExampleWithMetadataClosure
24 |
25 | // MARK: Suite Hooks
26 |
27 | /**
28 | A closure executed before any examples are run.
29 | */
30 | public typealias BeforeSuiteClosure = () -> Void
31 |
32 | /**
33 | A closure executed after all examples have finished running.
34 | */
35 | public typealias AfterSuiteClosure = BeforeSuiteClosure
36 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift:
--------------------------------------------------------------------------------
1 | /**
2 | A container for closures to be executed before and after each example.
3 | */
4 | final internal class ExampleHooks {
5 | internal var befores: [BeforeExampleWithMetadataClosure] = []
6 | internal var afters: [AfterExampleWithMetadataClosure] = []
7 | internal var phase: HooksPhase = .nothingExecuted
8 |
9 | internal func appendBefore(_ closure: @escaping BeforeExampleWithMetadataClosure) {
10 | befores.append(closure)
11 | }
12 |
13 | internal func appendBefore(_ closure: @escaping BeforeExampleClosure) {
14 | befores.append { (_: ExampleMetadata) in closure() }
15 | }
16 |
17 | internal func appendAfter(_ closure: @escaping AfterExampleWithMetadataClosure) {
18 | afters.append(closure)
19 | }
20 |
21 | internal func appendAfter(_ closure: @escaping AfterExampleClosure) {
22 | afters.append { (_: ExampleMetadata) in closure() }
23 | }
24 |
25 | internal func executeBefores(_ exampleMetadata: ExampleMetadata) {
26 | phase = .beforesExecuting
27 | for before in befores {
28 | before(exampleMetadata)
29 | }
30 |
31 | phase = .beforesFinished
32 | }
33 |
34 | internal func executeAfters(_ exampleMetadata: ExampleMetadata) {
35 | phase = .aftersExecuting
36 | for after in afters {
37 | after(exampleMetadata)
38 | }
39 |
40 | phase = .aftersFinished
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift:
--------------------------------------------------------------------------------
1 | /**
2 | A description of the execution cycle of the current example with
3 | respect to the hooks of that example.
4 | */
5 | internal enum HooksPhase {
6 | case nothingExecuted
7 | case beforesExecuting
8 | case beforesFinished
9 | case aftersExecuting
10 | case aftersFinished
11 | }
12 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift:
--------------------------------------------------------------------------------
1 | /**
2 | A container for closures to be executed before and after all examples.
3 | */
4 | final internal class SuiteHooks {
5 | internal var befores: [BeforeSuiteClosure] = []
6 | internal var afters: [AfterSuiteClosure] = []
7 | internal var phase: HooksPhase = .nothingExecuted
8 |
9 | internal func appendBefore(_ closure: @escaping BeforeSuiteClosure) {
10 | befores.append(closure)
11 | }
12 |
13 | internal func appendAfter(_ closure: @escaping AfterSuiteClosure) {
14 | afters.append(closure)
15 | }
16 |
17 | internal func executeBefores() {
18 | phase = .beforesExecuting
19 | for before in befores {
20 | before()
21 | }
22 | phase = .beforesFinished
23 | }
24 |
25 | internal func executeAfters() {
26 | phase = .aftersExecuting
27 | for after in afters {
28 | after()
29 | }
30 | phase = .aftersFinished
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift:
--------------------------------------------------------------------------------
1 | #if canImport(Darwin)
2 |
3 | import Foundation
4 |
5 | extension Bundle {
6 |
7 | /**
8 | Locates the first bundle with a '.xctest' file extension.
9 | */
10 | internal static var currentTestBundle: Bundle? {
11 | return allBundles.first { $0.bundlePath.hasSuffix(".xctest") }
12 | }
13 |
14 | /**
15 | Return the module name of the bundle.
16 | Uses the bundle filename and transform it to match Xcode's transformation.
17 | Module name has to be a valid "C99 extended identifier".
18 | */
19 | internal var moduleName: String {
20 | let fileName = bundleURL.fileName
21 | return fileName.c99ExtendedIdentifier
22 | }
23 | }
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift:
--------------------------------------------------------------------------------
1 | #if canImport(Darwin)
2 | import Foundation
3 |
4 | /**
5 | Responsible for building a "Selected tests" suite. This corresponds to a single
6 | spec, and all its examples.
7 | */
8 | internal class QuickSelectedTestSuiteBuilder: QuickTestSuiteBuilder {
9 |
10 | /**
11 | The test spec class to run.
12 | */
13 | let testCaseClass: AnyClass!
14 |
15 | /**
16 | For Objective-C classes, returns the class name. For Swift classes without,
17 | an explicit Objective-C name, returns a module-namespaced class name
18 | (e.g., "FooTests.FooSpec").
19 | */
20 | var testSuiteClassName: String {
21 | return NSStringFromClass(testCaseClass)
22 | }
23 |
24 | /**
25 | Given a test case name:
26 |
27 | FooSpec/testFoo
28 |
29 | Optionally constructs a test suite builder for the named test case class
30 | in the running test bundle.
31 |
32 | If no test bundle can be found, or the test case class can't be found,
33 | initialization fails and returns `nil`.
34 | */
35 | init?(forTestCaseWithName name: String) {
36 | guard let testCaseClass = testCaseClassForTestCaseWithName(name) else {
37 | self.testCaseClass = nil
38 | return nil
39 | }
40 |
41 | self.testCaseClass = testCaseClass
42 | }
43 |
44 | /**
45 | Returns a `QuickTestSuite` that runs the associated test case class.
46 | */
47 | func buildTestSuite() -> QuickTestSuite {
48 | return QuickTestSuite(forTestCaseClass: testCaseClass)
49 | }
50 |
51 | }
52 |
53 | /**
54 | Searches `Bundle.allBundles()` for an xctest bundle, then looks up the named
55 | test case class in that bundle.
56 |
57 | Returns `nil` if a bundle or test case class cannot be found.
58 | */
59 | private func testCaseClassForTestCaseWithName(_ name: String) -> AnyClass? {
60 | func extractClassName(_ name: String) -> String? {
61 | return name.components(separatedBy: "/").first
62 | }
63 |
64 | guard let className = extractClassName(name) else { return nil }
65 | guard let bundle = Bundle.currentTestBundle else { return nil }
66 |
67 | if let testCaseClass = bundle.classNamed(className) { return testCaseClass }
68 |
69 | let moduleName = bundle.moduleName
70 |
71 | return NSClassFromString("\(moduleName).\(className)")
72 | }
73 |
74 | #endif
75 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/QuickTestObservation.swift:
--------------------------------------------------------------------------------
1 | #if !SWIFT_PACKAGE
2 |
3 | import Foundation
4 | import XCTest
5 |
6 | /// A dummy protocol for calling the internal `+[QuickSpec buildExamplesIfNeeded]` method
7 | /// which is defined in Objective-C from Swift.
8 | @objc internal protocol _QuickSpecInternal {
9 | static func buildExamplesIfNeeded()
10 | }
11 |
12 | @objc internal final class QuickTestObservation: NSObject, XCTestObservation {
13 | @objc(sharedInstance)
14 | static let shared = QuickTestObservation()
15 |
16 | // Quick hooks into this event to compile example groups for each QuickSpec subclasses.
17 | //
18 | // If an exception occurs when compiling examples, report it to the user. Chances are they
19 | // included an expectation outside of a "it", "describe", or "context" block.
20 | func testBundleWillStart(_ testBundle: Bundle) {
21 | QuickSpec.enumerateSubclasses { specClass in
22 | // This relies on `_QuickSpecInternal`.
23 | (specClass as AnyClass).buildExamplesIfNeeded()
24 | }
25 | }
26 | }
27 |
28 | // swiftlint:disable:next todo
29 | // TODO: Unify this with QuickConfiguration's equivalent
30 | extension QuickSpec {
31 | internal static func enumerateSubclasses(
32 | subclasses: [QuickSpec.Type]? = nil,
33 | _ block: (QuickSpec.Type) -> Void
34 | ) {
35 | let subjects: [QuickSpec.Type]
36 | if let subclasses = subclasses {
37 | subjects = subclasses
38 | } else {
39 | let classesCount = objc_getClassList(nil, 0)
40 |
41 | guard classesCount > 0 else {
42 | return
43 | }
44 |
45 | let classes = UnsafeMutablePointer.allocate(capacity: Int(classesCount))
46 | defer { free(classes) }
47 |
48 | objc_getClassList(AutoreleasingUnsafeMutablePointer(classes), classesCount)
49 |
50 | var specSubclasses: [QuickSpec.Type] = []
51 | for index in 0.. QuickTestSuite
16 |
17 | }
18 |
19 | /**
20 | A base class for a class cluster of Quick test suites, that should correctly
21 | build dynamic test suites for XCTest to execute.
22 | */
23 | public class QuickTestSuite: XCTestSuite {
24 |
25 | private static var builtTestSuites: Set = Set()
26 |
27 | /**
28 | Construct a test suite for a specific, selected subset of test cases (rather
29 | than the default, which as all test cases).
30 |
31 | If this method is called multiple times for the same test case class, e.g..
32 |
33 | FooSpec/testFoo
34 | FooSpec/testBar
35 |
36 | It is expected that the first call should return a valid test suite, and
37 | all subsequent calls should return `nil`.
38 | */
39 | @objc
40 | public static func selectedTestSuite(forTestCaseWithName name: String) -> QuickTestSuite? {
41 | guard let builder = QuickSelectedTestSuiteBuilder(forTestCaseWithName: name) else { return nil }
42 |
43 | let (inserted, _) = builtTestSuites.insert(builder.testSuiteClassName)
44 | if inserted {
45 | return builder.buildTestSuite()
46 | } else {
47 | return nil
48 | }
49 | }
50 | }
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/String+C99ExtendedIdentifier.swift:
--------------------------------------------------------------------------------
1 | #if canImport(Darwin)
2 | import Foundation
3 |
4 | extension String {
5 | private static var invalidCharacters: CharacterSet = {
6 | var invalidCharacters = CharacterSet()
7 |
8 | let invalidCharacterSets: [CharacterSet] = [
9 | .whitespacesAndNewlines,
10 | .illegalCharacters,
11 | .controlCharacters,
12 | .punctuationCharacters,
13 | .nonBaseCharacters,
14 | .symbols,
15 | ]
16 |
17 | for invalidSet in invalidCharacterSets {
18 | invalidCharacters.formUnion(invalidSet)
19 | }
20 |
21 | return invalidCharacters
22 | }()
23 |
24 | internal var c99ExtendedIdentifier: String {
25 | let validComponents = components(separatedBy: String.invalidCharacters)
26 | let result = validComponents.joined(separator: "_")
27 |
28 | return result.isEmpty ? "_" : result
29 | }
30 | }
31 |
32 | /// Extension methods or properties for NSObject subclasses are invisible from
33 | /// the Objective-C runtime on static linking unless the consumers add `-ObjC`
34 | /// linker flag, so let's make a wrapper class to mitigate that situation.
35 | ///
36 | /// See: https://github.com/Quick/Quick/issues/785 and https://github.com/Quick/Quick/pull/803
37 | @objc
38 | class QCKObjCStringUtils: NSObject {
39 | override private init() {}
40 |
41 | @objc
42 | static func c99ExtendedIdentifier(from string: String) -> String {
43 | return string.c99ExtendedIdentifier
44 | }
45 | }
46 | #endif
47 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/Quick/URL+FileName.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension URL {
4 |
5 | /**
6 | Returns the path file name without file extension.
7 | */
8 | var fileName: String {
9 | return self.deletingPathExtension().lastPathComponent
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/QuickObjCRuntime/QuickSpecBase.m:
--------------------------------------------------------------------------------
1 | #import "QuickSpecBase.h"
2 |
3 | #pragma mark - _QuickSpecBase
4 |
5 | @implementation _QuickSpecBase
6 |
7 | - (instancetype)init {
8 | self = [super initWithInvocation: nil];
9 | return self;
10 | }
11 |
12 | /**
13 | Invocations for each test method in the test case. QuickSpec overrides this method to define a
14 | new method for each example defined in +[QuickSpec spec].
15 |
16 | @return An array of invocations that execute the newly defined example methods.
17 | */
18 | + (NSArray *)testInvocations {
19 | NSArray *selectors = [self _qck_testMethodSelectors];
20 | NSMutableArray *invocations = [NSMutableArray arrayWithCapacity:selectors.count];
21 |
22 | for (NSString *selectorString in selectors) {
23 | SEL selector = NSSelectorFromString(selectorString);
24 | NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector];
25 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
26 | invocation.selector = selector;
27 |
28 | [invocations addObject:invocation];
29 | }
30 |
31 | return invocations;
32 | }
33 |
34 | + (NSArray *)_qck_testMethodSelectors {
35 | return @[];
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/QuickObjCRuntime/include/QuickSpecBase.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface _QuickSpecBase : XCTestCase
5 | + (NSArray *)_qck_testMethodSelectors;
6 | - (instancetype)init NS_DESIGNATED_INITIALIZER;
7 | @end
8 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @class Configuration;
4 |
5 | /**
6 | Subclass QuickConfiguration and override the +[QuickConfiguration configure:]
7 | method in order to configure how Quick behaves when running specs, or to define
8 | shared examples that are used across spec files.
9 | */
10 | @interface QuickConfiguration : NSObject
11 |
12 | /**
13 | This method is executed on each subclass of this class before Quick runs
14 | any examples. You may override this method on as many subclasses as you like, but
15 | there is no guarantee as to the order in which these methods are executed.
16 |
17 | You can override this method in order to:
18 |
19 | 1. Configure how Quick behaves, by modifying properties on the Configuration object.
20 | Setting the same properties in several methods has undefined behavior.
21 |
22 | 2. Define shared examples using `sharedExamples`.
23 |
24 | @param configuration A mutable object that is used to configure how Quick behaves on
25 | a framework level. For details on all the options, see the
26 | documentation in Configuration.swift.
27 | */
28 | + (void)configure:(Configuration *)configuration;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.m:
--------------------------------------------------------------------------------
1 | #import "QuickConfiguration.h"
2 | #import
3 |
4 | #if __has_include("Quick-Swift.h")
5 | #import "Quick-Swift.h"
6 | #else
7 | #import
8 | #endif
9 |
10 | @implementation QuickConfiguration
11 |
12 | #pragma mark - Object Lifecycle
13 |
14 | /**
15 | QuickConfiguration is not meant to be instantiated; it merely provides a hook
16 | for users to configure how Quick behaves. Raise an exception if an instance of
17 | QuickConfiguration is created.
18 | */
19 | - (instancetype)init {
20 | NSString *className = NSStringFromClass([self class]);
21 | NSString *selectorName = NSStringFromSelector(@selector(configure:));
22 | [NSException raise:NSInternalInconsistencyException
23 | format:@"%@ is not meant to be instantiated; "
24 | @"subclass %@ and override %@ to configure Quick.",
25 | className, className, selectorName];
26 | return nil;
27 | }
28 |
29 | #pragma mark - NSObject Overrides
30 |
31 | /**
32 | Hook into when QuickConfiguration is initialized in the runtime in order to
33 | call +[QuickConfiguration configure:] on each of its subclasses.
34 | */
35 | + (void)initialize {
36 | // Only enumerate over the subclasses of QuickConfiguration, not any of its subclasses.
37 | if ([self class] == [QuickConfiguration class]) {
38 | World *world = [World sharedWorld];
39 | [self configureSubclassesIfNeededWithWorld:world];
40 | }
41 | }
42 |
43 | #pragma mark - Public Interface
44 |
45 | + (void)configure:(Configuration *)configuration { }
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.m:
--------------------------------------------------------------------------------
1 | #import "QCKDSL.h"
2 |
3 | #if __has_include("Quick-Swift.h")
4 | #import "Quick-Swift.h"
5 | #else
6 | #import
7 | #endif
8 |
9 | void qck_beforeSuite(QCKDSLEmptyBlock closure) {
10 | [[World sharedWorld] beforeSuite:closure];
11 | }
12 |
13 | void qck_afterSuite(QCKDSLEmptyBlock closure) {
14 | [[World sharedWorld] afterSuite:closure];
15 | }
16 |
17 | void qck_sharedExamples(NSString *name, QCKDSLSharedExampleBlock closure) {
18 | [[World sharedWorld] sharedExamples:name closure:closure];
19 | }
20 |
21 | void qck_describe(NSString *description, QCKDSLEmptyBlock closure) {
22 | [[World sharedWorld] describe:description flags:@{} closure:closure];
23 | }
24 |
25 | void qck_context(NSString *description, QCKDSLEmptyBlock closure) {
26 | qck_describe(description, closure);
27 | }
28 |
29 | void qck_beforeEach(QCKDSLEmptyBlock closure) {
30 | [[World sharedWorld] beforeEach:closure];
31 | }
32 |
33 | void qck_beforeEachWithMetadata(QCKDSLExampleMetadataBlock closure) {
34 | [[World sharedWorld] beforeEachWithMetadata:closure];
35 | }
36 |
37 | void qck_afterEach(QCKDSLEmptyBlock closure) {
38 | [[World sharedWorld] afterEach:closure];
39 | }
40 |
41 | void qck_afterEachWithMetadata(QCKDSLExampleMetadataBlock closure) {
42 | [[World sharedWorld] afterEachWithMetadata:closure];
43 | }
44 |
45 | QCKItBlock qck_it_builder(NSDictionary *flags, NSString *file, NSUInteger line) {
46 | return ^(NSString *description, QCKDSLEmptyBlock closure) {
47 | [[World sharedWorld] itWithDescription:description
48 | flags:flags
49 | file:file
50 | line:line
51 | closure:closure];
52 | };
53 | }
54 |
55 | QCKItBehavesLikeBlock qck_itBehavesLike_builder(NSDictionary *flags, NSString *file, NSUInteger line) {
56 | return ^(NSString *name, QCKDSLSharedExampleContext context) {
57 | [[World sharedWorld] itBehavesLikeSharedExampleNamed:name
58 | sharedExampleContext:context
59 | flags:flags
60 | file:file
61 | line:line];
62 | };
63 | }
64 |
65 | void qck_pending(NSString *description, QCKDSLEmptyBlock closure) {
66 | [[World sharedWorld] pending:description closure:closure];
67 | }
68 |
69 | void qck_xdescribe(NSString *description, QCKDSLEmptyBlock closure) {
70 | [[World sharedWorld] xdescribe:description flags:@{} closure:closure];
71 | }
72 |
73 | void qck_xcontext(NSString *description, QCKDSLEmptyBlock closure) {
74 | qck_xdescribe(description, closure);
75 | }
76 |
77 | void qck_fdescribe(NSString *description, QCKDSLEmptyBlock closure) {
78 | [[World sharedWorld] fdescribe:description flags:@{} closure:closure];
79 | }
80 |
81 | void qck_fcontext(NSString *description, QCKDSLEmptyBlock closure) {
82 | qck_fdescribe(description, closure);
83 | }
84 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/QuickObjectiveC/Quick.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | //! Project version number for Quick.
4 | FOUNDATION_EXPORT double QuickVersionNumber;
5 |
6 | //! Project version string for Quick.
7 | FOUNDATION_EXPORT const unsigned char QuickVersionString[];
8 |
9 | #import "QuickSpec.h"
10 | #import "QCKDSL.h"
11 | #import "QuickConfiguration.h"
12 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/QuickObjectiveC/QuickSpec.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | /**
4 | QuickSpec is a base class all specs written in Quick inherit from.
5 | They need to inherit from QuickSpec, a subclass of XCTestCase, in
6 | order to be discovered by the XCTest framework.
7 |
8 | XCTest automatically compiles a list of XCTestCase subclasses included
9 | in the test target. It iterates over each class in that list, and creates
10 | a new instance of that class for each test method. It then creates an
11 | "invocation" to execute that test method. The invocation is an instance of
12 | NSInvocation, which represents a single message send in Objective-C.
13 | The invocation is set on the XCTestCase instance, and the test is run.
14 |
15 | Most of the code in QuickSpec is dedicated to hooking into XCTest events.
16 | First, when the spec is first loaded and before it is sent any messages,
17 | the +[NSObject initialize] method is called. QuickSpec overrides this method
18 | to call +[QuickSpec spec]. This builds the example group stacks and
19 | registers them with Quick.World, a global register of examples.
20 |
21 | Then, XCTest queries QuickSpec for a list of test methods. Normally, XCTest
22 | automatically finds all methods whose selectors begin with the string "test".
23 | However, QuickSpec overrides this default behavior by implementing the
24 | +[XCTestCase testInvocations] method. This method iterates over each example
25 | registered in Quick.World, defines a new method for that example, and
26 | returns an invocation to call that method to XCTest. Those invocations are
27 | the tests that are run by XCTest. Their selector names are displayed in
28 | the Xcode test navigation bar.
29 | */
30 | @interface QuickSpec : XCTestCase
31 |
32 | /**
33 | Override this method in your spec to define a set of example groups
34 | and examples.
35 |
36 | @code
37 | override func spec() {
38 | describe("winter") {
39 | it("is coming") {
40 | // ...
41 | }
42 | }
43 | }
44 | @endcode
45 |
46 | See DSL.swift for more information on what syntax is available.
47 | */
48 | - (void)spec;
49 |
50 | /**
51 | Returns the currently executing spec. Use in specs that require XCTestCase
52 | methods, e.g. expectationWithDescription.
53 | */
54 | @property (class, nonatomic, readonly) QuickSpec *current;
55 |
56 | @end
57 |
--------------------------------------------------------------------------------
/Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | #if __has_include("Quick-Swift.h")
5 | #import "Quick-Swift.h"
6 | #else
7 | #import
8 | #endif
9 |
10 | @interface XCTestSuite (QuickTestSuiteBuilder)
11 | @end
12 |
13 | @implementation XCTestSuite (QuickTestSuiteBuilder)
14 |
15 | /**
16 | In order to ensure we can correctly build dynamic test suites, we need to
17 | replace some of the default test suite constructors.
18 | */
19 | + (void)load {
20 | Method testCaseWithName = class_getClassMethod(self, @selector(testSuiteForTestCaseWithName:));
21 | Method hooked_testCaseWithName = class_getClassMethod(self, @selector(qck_hooked_testSuiteForTestCaseWithName:));
22 | method_exchangeImplementations(testCaseWithName, hooked_testCaseWithName);
23 | }
24 |
25 | /**
26 | The `+testSuiteForTestCaseWithName:` method is called when a specific test case
27 | class is run from the Xcode test navigator. If the built test suite is `nil`,
28 | Xcode will not run any tests for that test case.
29 |
30 | Given if the following test case class is run from the Xcode test navigator:
31 |
32 | FooSpec
33 | testFoo
34 | testBar
35 |
36 | XCTest will invoke this once per test case, with test case names following this format:
37 |
38 | FooSpec/testFoo
39 | FooSpec/testBar
40 | */
41 | + (nullable instancetype)qck_hooked_testSuiteForTestCaseWithName:(nonnull NSString *)name {
42 | return [QuickTestSuite selectedTestSuiteForTestCaseWithName:name];
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 7.3.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Nimble-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 8.1.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Nimble-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Nimble : NSObject
3 | @end
4 | @implementation PodsDummy_Nimble
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Nimble-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Nimble-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "Nimble.h"
14 | #import "DSL.h"
15 | #import "NMBExceptionCapture.h"
16 | #import "NMBStringify.h"
17 | #import "CwlCatchException.h"
18 | #import "CwlMachBadInstructionHandler.h"
19 | #import "mach_excServer.h"
20 | #import "CwlPreconditionTesting.h"
21 |
22 | FOUNDATION_EXPORT double NimbleVersionNumber;
23 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
24 |
25 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Nimble.debug.xcconfig:
--------------------------------------------------------------------------------
1 | APPLICATION_EXTENSION_API_ONLY = YES
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Nimble
3 | DEFINES_MODULE = YES
4 | ENABLE_BITCODE = NO
5 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
6 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
7 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib"
8 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -weak-lswiftXCTest -weak_framework "XCTest"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_ROOT = ${SRCROOT}
13 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Nimble
14 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
15 | SKIP_INSTALL = YES
16 | SWIFT_INCLUDE_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib"
17 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
18 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
19 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Nimble.modulemap:
--------------------------------------------------------------------------------
1 | framework module Nimble {
2 | umbrella header "Nimble-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Nimble.release.xcconfig:
--------------------------------------------------------------------------------
1 | APPLICATION_EXTENSION_API_ONLY = YES
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Nimble
3 | DEFINES_MODULE = YES
4 | ENABLE_BITCODE = NO
5 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
6 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
7 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib"
8 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -weak-lswiftXCTest -weak_framework "XCTest"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_ROOT = ${SRCROOT}
13 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Nimble
14 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
15 | SKIP_INSTALL = YES
16 | SWIFT_INCLUDE_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib"
17 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
18 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
19 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Nimble/Nimble.xcconfig:
--------------------------------------------------------------------------------
1 | APPLICATION_EXTENSION_API_ONLY = YES
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Nimble
3 | ENABLE_BITCODE = NO
4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
6 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -weak-lswiftXCTest -weak_framework "XCTest"
7 | OTHER_SWIFT_FLAGS = $(inherited) -suppress-warnings $(inherited) "-D" "COCOAPODS" "-suppress-warnings"
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_ROOT = ${SRCROOT}
11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Nimble
12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
13 | SKIP_INSTALL = YES
14 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Pods-ASMapLauncher-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Pods-ASMapLauncher-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Pods-ASMapLauncher-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Pods-ASMapLauncher-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_ASMapLauncher : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_ASMapLauncher
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Pods-ASMapLauncher-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_ASMapLauncherVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_ASMapLauncherVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Pods-ASMapLauncher.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | PODS_BUILD_DIR = ${BUILD_DIR}
3 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
4 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
5 | PODS_ROOT = ${SRCROOT}/Pods
6 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Pods-ASMapLauncher.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_ASMapLauncher {
2 | umbrella header "Pods-ASMapLauncher-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncher/Pods-ASMapLauncher.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | PODS_BUILD_DIR = ${BUILD_DIR}
3 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
4 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
5 | PODS_ROOT = ${SRCROOT}/Pods
6 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncherTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncherTests/Pods-ASMapLauncherTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncherTests/Pods-ASMapLauncherTests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_ASMapLauncherTests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_ASMapLauncherTests
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncherTests/Pods-ASMapLauncherTests-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_ASMapLauncherTestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_ASMapLauncherTestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncherTests/Pods-ASMapLauncherTests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble" "${PODS_CONFIGURATION_BUILD_DIR}/Quick"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Nimble/Nimble.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Quick/Quick.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
6 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Nimble/Nimble.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Nimble"
7 | OTHER_LDFLAGS = $(inherited) -framework "Nimble" -framework "Quick" -framework "XCTest" -weak_framework "XCTest"
8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
9 | PODS_BUILD_DIR = ${BUILD_DIR}
10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
12 | PODS_ROOT = ${SRCROOT}/Pods
13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
14 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncherTests/Pods-ASMapLauncherTests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_ASMapLauncherTests {
2 | umbrella header "Pods-ASMapLauncherTests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-ASMapLauncherTests/Pods-ASMapLauncherTests.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/Nimble" "${PODS_CONFIGURATION_BUILD_DIR}/Quick"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Nimble/Nimble.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Quick/Quick.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
6 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Nimble/Nimble.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Nimble"
7 | OTHER_LDFLAGS = $(inherited) -framework "Nimble" -framework "Quick" -framework "XCTest" -weak_framework "XCTest"
8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
9 | PODS_BUILD_DIR = ${BUILD_DIR}
10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
12 | PODS_ROOT = ${SRCROOT}/Pods
13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
14 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.3.2
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Quick-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Quick-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Quick : NSObject
3 | @end
4 | @implementation PodsDummy_Quick
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Quick-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Quick-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "QuickConfiguration.h"
14 | #import "QCKDSL.h"
15 | #import "Quick.h"
16 | #import "QuickSpec.h"
17 |
18 | FOUNDATION_EXPORT double QuickVersionNumber;
19 | FOUNDATION_EXPORT const unsigned char QuickVersionString[];
20 |
21 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Quick.debug.xcconfig:
--------------------------------------------------------------------------------
1 | APPLICATION_EXTENSION_API_ONLY = YES
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Quick
3 | DEFINES_MODULE = YES
4 | ENABLE_BITCODE = NO
5 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
6 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
7 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib"
8 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -framework "XCTest"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_ROOT = ${SRCROOT}
13 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Quick
14 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
15 | SKIP_INSTALL = YES
16 | SWIFT_INCLUDE_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib"
17 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
18 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
19 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Quick.modulemap:
--------------------------------------------------------------------------------
1 | framework module Quick {
2 | umbrella header "Quick-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Quick.release.xcconfig:
--------------------------------------------------------------------------------
1 | APPLICATION_EXTENSION_API_ONLY = YES
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Quick
3 | DEFINES_MODULE = YES
4 | ENABLE_BITCODE = NO
5 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
6 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
7 | LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib"
8 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -framework "XCTest"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_ROOT = ${SRCROOT}
13 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Quick
14 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
15 | SKIP_INSTALL = YES
16 | SWIFT_INCLUDE_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/usr/lib"
17 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
18 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
19 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Quick/Quick.xcconfig:
--------------------------------------------------------------------------------
1 | APPLICATION_EXTENSION_API_ONLY = YES
2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Quick
3 | ENABLE_BITCODE = NO
4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"
5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
6 | OTHER_LDFLAGS = $(inherited) -Xlinker -no_application_extension -framework "XCTest"
7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_ROOT = ${SRCROOT}
11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Quick
12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
13 | SKIP_INSTALL = YES
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://travis-ci.org/abdullahselek/ASMapLauncher)
2 | 
3 | [](https://github.com/Carthage/Carthage)
4 | 
5 | 
6 |
7 | # ASMapLauncher
8 | ASMapLauncher is a library for iOS written in Swift that helps navigation with various mapping applications.
9 |
10 | ## Requirements
11 |
12 | | ASMapLauncher Version | Minimum iOS Target | Swift Version |
13 | |:--------------------:|:---------------------------:|:---------------------------:|
14 | | 1.0.8 | 11.x | 5.x |
15 | | 1.0.7 | 9.x | 4.2 |
16 | | 1.0.6 | 8.x | 4.0 |
17 | | 1.0.5 | 8.0 | 3.x |
18 |
19 | ## CocoaPods
20 |
21 | CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
22 | ```
23 | $ gem install cocoapods
24 | ```
25 | To integrate ASMapLauncher into your Xcode project using CocoaPods, specify it in your Podfile:
26 | ```
27 | source 'https://github.com/CocoaPods/Specs.git'
28 | platform :ios, '11.0'
29 | use_frameworks!
30 |
31 | target '' do
32 | pod 'ASMapLauncher', '1.0.8'
33 | end
34 | ```
35 | Then, run the following command:
36 | ```
37 | $ pod install
38 | ```
39 | ## Carthage
40 |
41 | Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
42 |
43 | You can install Carthage with Homebrew using the following command:
44 |
45 | ```
46 | brew update
47 | brew install carthage
48 | ```
49 |
50 | To integrate ASMapLauncher into your Xcode project using Carthage, specify it in your Cartfile:
51 |
52 | ```
53 | github "abdullahselek/ASMapLauncher" ~> 1.0.8
54 | ```
55 |
56 | Run carthage update to build the framework and drag the built ASMapLauncher.framework into your Xcode project.
57 |
58 | ## Usage
59 |
60 | First initiate ASMapLauncher and check for a selected mapping application that installed on device
61 | ```
62 | let mapLauncher = ASMapLauncher()
63 | let isInstalled = mapLauncher.isMapAppInstalled(.here)
64 | ```
65 |
66 | Then, launch selected mapping application
67 | ```
68 | if isInstalled {
69 | let destination: CLLocation! = CLLocation(latitude: 41.0053215, longitude: 29.0121795)
70 | let fromMapPoint: MapPoint! = MapPoint(location: CLLocation(latitude: currenctCoordinate.latitude,
71 | longitude: currenctCoordinate.longitude),
72 | name: "",
73 | address: "")
74 | let toMapPoint: MapPoint! = MapPoint(location: CLLocation(latitude: destination.coordinate.latitude, longitude: destination.coordinate.longitude),
75 | name: "",
76 | address: "")
77 | mapLauncher.launchMapApp(.here,
78 | fromDirections: fromMapPoint,
79 | toDirection: toMapPoint)
80 | }
81 |
82 | ```
83 | Supported mapping applications
84 | ```
85 | - Apple Maps
86 | - HERE Maps
87 | - Google Maps
88 | - Yandex Navigator
89 | - Citymapper
90 | - Navigon
91 | - The Transit App
92 | - Waze
93 | - Moovit
94 | ```
95 |
96 | ## MIT License
97 | ```
98 | Copyright (c) 2015 Abdullah Selek
99 |
100 | Permission is hereby granted, free of charge, to any person obtaining a copy
101 | of this software and associated documentation files (the "Software"), to deal
102 | in the Software without restriction, including without limitation the rights
103 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
104 | copies of the Software, and to permit persons to whom the Software is
105 | furnished to do so, subject to the following conditions:
106 |
107 | The above copyright notice and this permission notice shall be included in all
108 | copies or substantial portions of the Software.
109 |
110 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
111 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
112 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
113 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
114 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
115 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
116 | SOFTWARE.
117 | ```
118 |
--------------------------------------------------------------------------------