Skip to content

Commit

Permalink
Merge pull request #273 from compnerd/windows
Browse files Browse the repository at this point in the history
  • Loading branch information
drmohundro authored May 10, 2023
2 parents 3eb1930 + 8547082 commit 690df91
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.xml text eol=lf
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,18 @@ jobs:
run: |
eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
swift test
windows-test:
name: Windows Test
runs-on: windows-latest

steps:
- name: Install Swift
uses: compnerd/gha-setup-swift@main
with:
branch: swift-5.8-release
tag: 5.8-RELEASE
- name: Checkout
uses: actions/checkout@master
- name: Build and test
run: swift test
2 changes: 1 addition & 1 deletion Source/FullXMLParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import Foundation

#if os(Linux)
#if os(Linux) || os(Windows)
import FoundationXML
#endif

Expand Down
2 changes: 1 addition & 1 deletion Source/LazyXMLParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import Foundation

#if os(Linux)
#if os(Linux) || os(Windows)
import FoundationXML
#endif

Expand Down
2 changes: 1 addition & 1 deletion Tests/SWXMLHashTests/LazyWhiteSpaceParsingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LazyWhiteSpaceParsingTests: XCTestCase {
// Put setup code here. This method is called before the invocation of each test method in the class.

#if SWIFT_PACKAGE
let path = NSString.path(withComponents: NSString(string: #file).pathComponents.dropLast() + ["test.xml"])
let path = URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("test.xml").path
#else
let bundle = Bundle(for: WhiteSpaceParsingTests.self)
let path = bundle.path(forResource: "test", ofType: "xml")!
Expand Down
2 changes: 1 addition & 1 deletion Tests/SWXMLHashTests/WhiteSpaceParsingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class WhiteSpaceParsingTests: XCTestCase {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
#if SWIFT_PACKAGE
let path = NSString.path(withComponents: NSString(string: #file).pathComponents.dropLast() + ["test.xml"])
let path = URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("test.xml").path
#else
let bundle = Bundle(for: WhiteSpaceParsingTests.self)
let path = bundle.path(forResource: "test", ofType: "xml")!
Expand Down
2 changes: 1 addition & 1 deletion Tests/SWXMLHashTests/XMLParsingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class XMLParsingTests: XCTestCase {

XCTAssertNotNil(err)

#if !os(Linux)
#if !(os(Linux) || os(Windows))
if err != nil {
XCTAssert(err!.line == 1)
}
Expand Down

0 comments on commit 690df91

Please sign in to comment.