diff --git a/.travis.yml b/.travis.yml index d2b1a9cb..d43e73b8 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 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 after_success: - bash <(curl -s https://codecov.io/bash) 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 { 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),