File tree 6 files changed +62
-1
lines changed
Examples/MacExample-SwiftPackageManager
6 files changed +62
-1
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,5 @@ project.xcworkspace/
9
9
xcuserdata /
10
10
compile_commands.json
11
11
.swiftpm
12
- .build
12
+ .build
13
+ Examples /MacExample-SwiftPackageManager /Package.resolved
Original file line number Diff line number Diff line change
1
+ // swift-tools-version:5.3
2
+ // The swift-tools-version declares the minimum version of Swift required to build this package.
3
+
4
+ import PackageDescription
5
+
6
+ let package = Package (
7
+ name: " Example " ,
8
+ products: [
9
+ . library(
10
+ name: " Example " ,
11
+ targets: [ " Example " ] ) ,
12
+ ] ,
13
+ dependencies: [
14
+ . package (
15
+ name: " OCHamcrest " ,
16
+ url: " https://github.com/hamcrest/OCHamcrest " ,
17
+ . branch( " main " )
18
+ ) ,
19
+ ] ,
20
+ targets: [
21
+ . target(
22
+ name: " Example " ,
23
+ dependencies: [ ] ,
24
+ publicHeadersPath: " ./ "
25
+ ) ,
26
+ . testTarget(
27
+ name: " ExampleTests " ,
28
+ dependencies: [
29
+ " Example " ,
30
+ " OCHamcrest " ,
31
+ ]
32
+ ) ,
33
+ ]
34
+ )
Original file line number Diff line number Diff line change
1
+ ` swift test ` to run unit tests. Try changing the test to fail.
Original file line number Diff line number Diff line change
1
+ @import Foundation;
2
+
3
+ @interface Example : NSObject
4
+ @end
Original file line number Diff line number Diff line change
1
+ #import " Example.h"
2
+
3
+ @implementation Example
4
+ @end
Original file line number Diff line number Diff line change
1
+ @import OCHamcrest;
2
+ @import XCTest;
3
+
4
+
5
+ @interface ExampleTests : XCTestCase
6
+ @end
7
+
8
+ @implementation ExampleTests
9
+
10
+ - (void )testUsingAssertThat
11
+ {
12
+ assertThat (@" xx" , is (@" xx" ));
13
+ assertThat (@" yy" , isNot (@" xx" ));
14
+ assertThat (@" i like cheese" , containsSubstring (@" cheese" ));
15
+ }
16
+
17
+ @end
You can’t perform that action at this time.
0 commit comments