Skip to content

Commit d274592

Browse files
committed
Fixed test
1 parent 2b8cef7 commit d274592

File tree

3 files changed

+43
-27
lines changed

3 files changed

+43
-27
lines changed

splitio/example/ios/Podfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ target 'Runner' do
3232
use_modular_headers!
3333

3434
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35-
36-
pod 'Split', :git => 'https://github.com/splitio/ios-client.git', :branch => 'SDKS-9073_baseline' # TODO: remove; development only
3735
end
3836

3937
post_install do |installer|

splitio/example/ios/Podfile.lock

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PODS:
2+
- Flutter (1.0.0)
3+
- Split (3.3.2)
4+
- splitio_ios (0.8.0):
5+
- Flutter
6+
- Split (~> 3.3.2)
7+
8+
DEPENDENCIES:
9+
- Flutter (from `Flutter`)
10+
- splitio_ios (from `.symlinks/plugins/splitio_ios/ios`)
11+
12+
SPEC REPOS:
13+
trunk:
14+
- Split
15+
16+
EXTERNAL SOURCES:
17+
Flutter:
18+
:path: Flutter
19+
splitio_ios:
20+
:path: ".symlinks/plugins/splitio_ios/ios"
21+
22+
SPEC CHECKSUMS:
23+
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
24+
Split: 0d4962a6c15180e1857c1a3753e1ae9c91a6150b
25+
splitio_ios: 438ad21d0dfe467670f8b9508773b77b16a71d6b
26+
27+
PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048
28+
29+
COCOAPODS: 1.16.2

splitio_ios/example/ios/SplitTests/ExtensionsTests.swift

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class ExtensionsTests: XCTestCase {
1414
impression.label = "label"
1515
impression.treatment = "on"
1616
impression.time = 16161616
17+
impression.properties = "{\"myProp\": true}"
1718

1819
let impressionMap = impression.toMap()
1920
XCTAssert(impressionMap.count == 9)
@@ -26,7 +27,7 @@ class ExtensionsTests: XCTestCase {
2627
"treatment": "on",
2728
"split": "my-split",
2829
"time": 16161616,
29-
"properties": "{}"]))
30+
"properties": "{\"myProp\": true}"]))
3031
}
3132

3233
func testSplitViewMapping() throws {
@@ -39,14 +40,20 @@ class ExtensionsTests: XCTestCase {
3940
splitView.configs = ["key": "value"]
4041
splitView.defaultTreatment = "off"
4142
splitView.sets = ["set1", "set2"]
43+
44+
let prerequisiteJSON = """
45+
{
46+
"n": "pre1",
47+
"t": ["on", "off"]
48+
}
49+
""".data(using: .utf8)!
50+
51+
let prerequisite = try JSONDecoder().decode(Prerequisite.self, from: prerequisiteJSON)
52+
splitView.prerequisites = [prerequisite]
4253
splitView.impressionsDisabled = true
4354

4455
let splitViewMap = SplitView.asMap(splitView: splitView)
45-
46-
// Debug: Print actual values
47-
print("DEBUG - SplitView map count: \(splitViewMap.count)")
48-
print("DEBUG - SplitView map: \(splitViewMap)")
49-
56+
5057
XCTAssert(splitViewMap.count == 10)
5158
XCTAssert(NSDictionary(dictionary: splitViewMap).isEqual(to: [
5259
"name": "my-split",
@@ -58,24 +65,6 @@ class ExtensionsTests: XCTestCase {
5865
"defaultTreatment": "off",
5966
"sets": ["set1", "set2"],
6067
"impressionsDisabled": true,
61-
"prerequisites": []]))
62-
}
63-
64-
func testImpressionMappingDebug() throws {
65-
var impression = Impression()
66-
impression.keyName = "matching-key"
67-
impression.feature = "my-split"
68-
impression.changeNumber = 121212
69-
impression.bucketingKey = "bucketing-key"
70-
impression.attributes = ["age": 25, "name": "John"]
71-
impression.label = "label"
72-
impression.treatment = "on"
73-
impression.time = 16161616
74-
75-
let impressionMap = impression.toMap()
76-
77-
// Debug: Print actual values
78-
print("DEBUG - Impression map count: \(impressionMap.count)")
79-
print("DEBUG - Impression map: \(impressionMap)")
68+
"prerequisites": [prerequisite]]))
8069
}
8170
}

0 commit comments

Comments
 (0)