@@ -52,9 +52,9 @@ if #available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) {
52
52
expectEqual ( node. attributeValues [ " test " ] , attrVal)
53
53
}
54
54
55
- SpriteKitTests . test ( " SKWarpGeometryGrid " ) {
55
+ SpriteKitTests . test ( " SKWarpGeometryGrid/1 " ) {
56
56
var warpGrid = SKWarpGeometryGrid ( columns: 1 , rows: 1 )
57
- expectEqual ( warpGrid. numberOfColumns, 1 )
57
+ expectEqual ( warpGrid. numberOfColumns, 1 )
58
58
59
59
expectEqual ( warpGrid. sourcePosition ( at: 0 ) . x, 0.0 )
60
60
warpGrid = warpGrid. replacingBySourcePositions ( positions: [ float2 ( 1.0 ) , float2 ( 2.0 ) , float2 ( 3.0 ) , float2 ( 4.0 ) ] )
@@ -76,6 +76,19 @@ if #available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) {
76
76
expectEqual ( warpGrid. destPosition ( at: 0 ) . x, 1.0 )
77
77
expectEqual ( warpGrid. sourcePosition ( at: 0 ) . x, 2.0 )
78
78
}
79
+
80
+ SpriteKitTests . test ( " SKWarpGeometryGrid/2 " ) {
81
+ var warpGrid = SKWarpGeometryGrid ( columns: 3 , rows: 4 )
82
+ expectEqual ( warpGrid. numberOfColumns, 3 )
83
+
84
+ expectEqual ( warpGrid. sourcePosition ( at: 0 ) . x, 0.0 )
85
+ warpGrid = warpGrid. replacingBySourcePositions ( positions: [ float2 ( 30.0 ) ] )
86
+ expectEqual ( warpGrid. sourcePosition ( at: 0 ) . x, 30.0 )
87
+
88
+ expectEqual ( warpGrid. destPosition ( at: 0 ) . x, 0.0 )
89
+ warpGrid = warpGrid. replacingByDestinationPositions ( positions: [ float2 ( 30.0 ) ] )
90
+ expectEqual ( warpGrid. destPosition ( at: 0 ) . x, 30.0 )
91
+ }
79
92
}
80
93
81
94
runAllTests ( )
0 commit comments