From 68c10ee9c00ac2fc8fb3a9c75ab131a06e85f9d2 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 17 Apr 2024 13:48:28 -0600 Subject: switch to compactMap --- Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Tests/SwiftChessNeoTests') diff --git a/Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift b/Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift index 310a53c..959d357 100644 --- a/Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift +++ b/Tests/SwiftChessNeoTests/SwiftChessNeoTests.swift @@ -67,7 +67,7 @@ final class Sage2Tests: XCTestCase { func testBoardSequence() { let board = Board() let spaces = Array(board) - let pieces = spaces.flatMap({ $0.piece }) + let pieces = spaces.compactMap({ $0.piece }) let whitePieces = pieces.filter({ $0.color.isWhite }) let blackPieces = pieces.filter({ $0.color.isBlack }) XCTAssertEqual(spaces.count, 64) -- cgit v1.2.3