@@ -92,6 +92,17 @@ private enum State {
9292 case loadedWithNoArguments
9393}
9494
95+ fileprivate struct ChartValue : Hashable {
96+ enum MetricState : Hashable {
97+ case positive
98+ case warning
99+ case neutral
100+ }
101+
102+ let values : [ Double ]
103+ let state : MetricState
104+ }
105+
95106extension String {
96107 func adjustingFor( indentationType: IndentationType ) -> String {
97108 switch indentationType {
@@ -297,6 +308,12 @@ class DifferenceTests: XCTestCase {
297308 received: ByteCountFormatter . CountStyle. decimal,
298309 expectedResults: [ " Received: 2 \n Expected: 3 \n " ]
299310 )
311+
312+ runTest (
313+ expected: Formatter . Context. beginningOfSentence,
314+ received: Formatter . Context. dynamic,
315+ expectedResults: [ " Received: 1 \n Expected: 4 \n " ]
316+ )
300317 }
301318
302319 func test_canFindObjCEnumDifferenceInArrayOfEnums( ) {
@@ -348,6 +365,14 @@ class DifferenceTests: XCTestCase {
348365 )
349366 }
350367
368+ func test_cannotFindDifferenceWithSameSwiftEnumEmbeededInObjects( ) {
369+ runTest (
370+ expected: ChartValue ( values: [ 1 , 2 ] , state: . positive) ,
371+ received: ChartValue ( values: [ 1 , 2 ] , state: . positive) ,
372+ expectedResults: [ " " ]
373+ )
374+ }
375+
351376 func test_cannotFindDifferenceWithSameObjects( ) {
352377 runTest ( expected: truth, received: truth, expectedResults: [ " " ] )
353378 }
@@ -378,6 +403,7 @@ extension DifferenceTests {
378403 ( " test_cannotFindDifferenceWithSameSwiftEnum " , test_cannotFindDifferenceWithSameSwiftEnum) ,
379404 ( " test_cannotFindDifferenceWithSameObjects " , test_cannotFindDifferenceWithSameObjects) ,
380405 ( " test_canFindObjCEnumDifferenceInArrayOfEnums " , test_canFindObjCEnumDifferenceInArrayOfEnums) ,
406+ ( " test_cannotFindDifferenceWithSameSwiftEnumEmbeededInObjects " , test_cannotFindDifferenceWithSameSwiftEnumEmbeededInObjects) ,
381407 ( " test_canFindObjCEnumDifferenceInArrayOfStructures " , test_canFindObjCEnumDifferenceInArrayOfStructures) ,
382408 ]
383409}
0 commit comments