This repository was archived by the owner on Feb 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Sources/XcodeGraph/Extensions
Tests/XcodeGraphTests/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,19 +31,9 @@ extension SettingsDictionary {
3131 }
3232 switch oldValue {
3333 case let . array( values) :
34- return . array(
35- Array (
36- Set ( values + newValues)
37- )
38- )
34+ return . array( values + newValues)
3935 case let . string( value) :
40- return . array(
41- Array (
42- Set (
43- value. split ( separator: " " ) . map ( String . init) + newValues
44- )
45- )
46- )
36+ return . array( value. split ( separator: " " ) . map ( String . init) + newValues)
4737 }
4838 } )
4939 }
Original file line number Diff line number Diff line change 11import Foundation
2- import Testing
2+ import XCTest
33
44@testable import XcodeGraph
55
6- struct SettingsDictionaryExtrasTest {
7- @Test
8- func test_combine_doesNotIncludeDuplicates( ) {
9- // Given
10- let settings : [ String : SettingValue ] = [
11- " A " : . array( [ " first value " , " second value " ] ) ,
12- ]
13-
14- // When
15- let got = settings. combine (
16- with: [
17- " A " : . array(
18- [
19- " first value " , " third value " ,
20- ]
21- ) ,
22- ]
23- )
24- . mapValues { value -> SettingValue in
25- switch value {
26- case let . array( values) : return . array( values. sorted ( ) )
27- default : return value
28- }
29- }
30-
31- // Then
32- #expect(
33- got == [
34- " A " : . array(
35- [
36- " first value " , " second value " , " third value " ,
37- ]
38- ) ,
39- ]
40- )
41- }
42-
43- @Test
6+ final class SettingsDictionaryExtrasTest : XCTestCase {
447 func testOverlay_addsPlatformSpecifierWhenSettingsDiffer( ) {
458 // Given
469 var settings : [ String : SettingValue ] = [
@@ -56,13 +19,11 @@ struct SettingsDictionaryExtrasTest {
5619 ] , for: . macOS)
5720
5821 // Then
59- #expect(
60- settings == [
61- " A[sdk=macosx*] " : " overlayed value " ,
62- " A " : " a value " ,
63- " B " : " b value " ,
64- " C[sdk=macosx*] " : " c value " ,
65- ]
66- )
22+ XCTAssertEqual ( settings, [
23+ " A[sdk=macosx*] " : " overlayed value " ,
24+ " A " : " a value " ,
25+ " B " : " b value " ,
26+ " C[sdk=macosx*] " : " c value " ,
27+ ] )
6728 }
6829}
You can’t perform that action at this time.
0 commit comments