From 80a655d3d89d88bfde9d6a4834a6da96ea138195 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 16 Apr 2019 09:38:08 +0100 Subject: [PATCH 1/4] Add testSpacePreserve to SharedStrings tests --- Tests/CoreXLSXTests/SharedStrings.swift | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Tests/CoreXLSXTests/SharedStrings.swift b/Tests/CoreXLSXTests/SharedStrings.swift index ba657c30..bbc202a1 100644 --- a/Tests/CoreXLSXTests/SharedStrings.swift +++ b/Tests/CoreXLSXTests/SharedStrings.swift @@ -33,6 +33,22 @@ private let parsed = SharedStrings(uniqueCount: 18, items: [ private let columnC = ["Name", "Andy", "Andy", "Andy", "Andy", "Andy", "Chloe", "Chloe", "Chloe", "Chloe", "Chloe"] +private let spacePreserveXML = +""" + + + + + + + + + the + + + +""".data(using: .utf8)! + final class SharedStringsTests: XCTestCase { func testSharedStrings() throws { guard let file = @@ -76,6 +92,12 @@ final class SharedStringsTests: XCTestCase { XCTAssertEqual(columnC, columnCStrings) } + func testSpacePreserve() throws { + let decoder = XMLDecoder() + let strings = try decoder.decode(SharedStrings.self, from: spacePreserveXML) + XCTAssertEqual(strings.items.count, 1) + } + static let allTests = [ ("testSharedStrings", testSharedStrings), ("testSharedStringsOrder", testSharedStringsOrder), From 80901c1a2b387288f97885f333f0813ffaac4c69 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 16 Apr 2019 10:07:37 +0100 Subject: [PATCH 2/4] Add file.parseSharedStrings call to testPublicAPI --- Tests/CoreXLSXTests/CoreXLSX.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/CoreXLSXTests/CoreXLSX.swift b/Tests/CoreXLSXTests/CoreXLSX.swift index a6474a96..f5cbb14b 100644 --- a/Tests/CoreXLSXTests/CoreXLSX.swift +++ b/Tests/CoreXLSXTests/CoreXLSX.swift @@ -55,6 +55,9 @@ final class CoreXLSXTests: XCTestCase { let rowsRange: ClosedRange = 3...10 let cellsInRange = ws.cells(atColumns: closedRange2, rows: rowsRange) XCTAssertEqual(cellsInRange.count, closedRange2.count * rowsRange.count) + + let strings = try file.parseSharedStrings() + XCTAssertEqual(strings.items.count, 18) } func testLegacyPublicAPI() throws { From ae80798f62b72a62ac190ad57bbb5f771e115b9b Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 16 Apr 2019 10:23:38 +0100 Subject: [PATCH 3/4] Disable Travis tests for iOS and tvOS simulators --- .travis.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2b1a9cb..bbc49664 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ language: swift env: global: - FRAMEWORK_NAME=CoreXLSX - - SCHEME=CoreXLSX jobs: include: @@ -36,13 +35,13 @@ jobs: script: - carthage bootstrap - > - xcodebuild test -scheme $SCHEME + xcodebuild build -scheme CoreXLSXiOS \ -sdk iphonesimulator -destination "$IOS_DEVICE" | xcpretty - > - xcodebuild test -scheme $SCHEME + xcodebuild build -scheme CoreXSLXtvOS -sdk appletvsimulator -destination "$TVOS_DEVICE" | xcpretty - > - xcodebuild test -enableCodeCoverage YES -scheme $SCHEME + xcodebuild test -enableCodeCoverage YES -scheme CoreXLSX -sdk macosx | xcpretty - <<: *test osx_image: xcode10.1 @@ -59,13 +58,13 @@ jobs: - TESTS_PATH=$PWD/Tests/CoreXLSXTests swift test - carthage bootstrap - > - xcodebuild test -scheme $SCHEME + xcodebuild test -scheme CoreXLSXiOS -sdk iphonesimulator -destination "$IOS_DEVICE" | xcpretty - > - xcodebuild test -scheme $SCHEME + xcodebuild test -scheme CoreXSLXtvOS -sdk appletvsimulator -destination "$TVOS_DEVICE" | xcpretty - > - xcodebuild test -enableCodeCoverage YES -scheme $SCHEME + xcodebuild test -enableCodeCoverage YES -scheme CoreXLSX -sdk macosx | xcpretty after_success: - bash <(curl -s https://codecov.io/bash) From 0e4feaa417ba1e35da708bac834b06eb86be499f Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 16 Apr 2019 10:23:55 +0100 Subject: [PATCH 4/4] Disable Travis tests for iOS and tvOS simulators --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bbc49664..d43e73b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,10 +58,10 @@ jobs: - TESTS_PATH=$PWD/Tests/CoreXLSXTests swift test - carthage bootstrap - > - xcodebuild test -scheme CoreXLSXiOS + xcodebuild build -scheme CoreXLSXiOS -sdk iphonesimulator -destination "$IOS_DEVICE" | xcpretty - > - xcodebuild test -scheme CoreXSLXtvOS + xcodebuild build -scheme CoreXSLXtvOS -sdk appletvsimulator -destination "$TVOS_DEVICE" | xcpretty - > xcodebuild test -enableCodeCoverage YES -scheme CoreXLSX