You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
guard case let.structured(name, _, _, totalChildrenCount, children, disposition)= logEntry else{
90
+
XCTFail("Expected a structured log entry")
91
+
return
92
+
}
93
+
94
+
XCTAssertEqual(name,"set")
95
+
96
+
// We expect `totalChildrenCount` to be 1000 because `set` has 1000 elements.
97
+
XCTAssertEqual(totalChildrenCount,1000)
98
+
99
+
// We expect `children.count` to be 101 due to the default logging policy, which encodes the first 80 and the last 20 children when there's more than 100 children, plus a gap in between to indicate what was elided.
100
+
XCTAssertEqual(children.count,101)
101
+
102
+
for(index, childEntry)in children.enumerated(){
103
+
if index ==80{
104
+
// We expect the 81st child to be a gap based on the default logging policy for containers.
105
+
guard case .gap = childEntry else{
106
+
XCTFail("Expected this entry to be a gap entry!")
107
+
return
108
+
}
109
+
}
110
+
else{
111
+
// We expect all other children to be opaque entries representing the Ints in the set.
112
+
guard case let.opaque(_, _, _, _, representation)= childEntry else{
113
+
XCTFail("Expected this entry to be an opaque entry!")
114
+
return
115
+
}
116
+
117
+
// We don't know the precise value, due to hashing in the set.
118
+
// But we *do* know that the value should be an Int64, so check that at least.
0 commit comments