()
let options: SWXMLHashOptions
func parse(_ data: Data) -> XMLIndexer {
// clear any prior runs of parse... expected that this won't be necessary,
// but you never know
parentStack.removeAll()
parentStack.push(root)
let parser = Foundation.XMLParser(data: data)
parser.shouldProcessNamespaces = options.shouldProcessNamespaces
parser.delegate = self
parser.parse()
return XMLIndexer(root)
}
func parser(_ parser: Foundation.XMLParser,
didStartElement elementName: String,
namespaceURI: String?,
qualifiedName qName: String?,
attributes attributeDict: [String: String]) {
#if os(Linux)
let attributeNSDict = NSDictionary(objects: attributeDict.values.flatMap({ $0 as? AnyObject }), forKeys: attributeDict.keys.map({ NSString(string: $0) as NSObject }))
let currentNode = parentStack.top().addElement(elementName, withAttributes: attributeNSDict)
#else
let currentNode = parentStack.top().addElement(elementName, withAttributes: attributeDict as NSDictionary)
#endif
parentStack.push(currentNode)
}
func parser(_ parser: Foundation.XMLParser, foundCharacters string: String) {
let current = parentStack.top()
current.addText(string)
}
func parser(_ parser: Foundation.XMLParser,
didEndElement elementName: String,
namespaceURI: String?,
qualifiedName qName: String?) {
parentStack.drop()
}
}
/// Represents an indexed operation against a lazily parsed `XMLIndexer`
public class IndexOp {
var index: Int
let key: String
init(_ key: String) {
self.key = key
self.index = -1
}
func toString() -> String {
if index >= 0 {
return key + " " + index.description
}
return key
}
}
/// Represents a collection of `IndexOp` instances. Provides a means of iterating them
/// to find a match in a lazily parsed `XMLIndexer` instance.
public class IndexOps {
var ops: [IndexOp] = []
let parser: LazyXMLParser
init(parser: LazyXMLParser) {
self.parser = parser
}
func findElements() -> XMLIndexer {
parser.startParsing(ops)
let indexer = XMLIndexer(parser.root)
var childIndex = indexer
for op in ops {
childIndex = childIndex[op.key]
if op.index >= 0 {
childIndex = childIndex[op.index]
}
}
ops.removeAll(keepingCapacity: false)
return childIndex
}
func stringify() -> String {
var s = ""
for op in ops {
s += "[" + op.toString() + "]"
}
return s
}
}
/// Error type that is thrown when an indexing or parsing operation fails.
public enum IndexingError: Error {
case Attribute(attr: String)
case AttributeValue(attr: String, value: String)
case Key(key: String)
case Index(idx: Int)
case Init(instance: AnyObject)
case Error
}
/// Returned from SWXMLHash, allows easy element lookup into XML data.
public enum XMLIndexer: Sequence {
case Element(XMLElement)
case List([XMLElement])
case Stream(IndexOps)
case XMLError(IndexingError)
/// The underlying XMLElement at the currently indexed level of XML.
public var element: XMLElement? {
switch self {
case .Element(let elem):
return elem
case .Stream(let ops):
let list = ops.findElements()
return list.element
default:
return nil
}
}
/// All elements at the currently indexed level
public var all: [XMLIndexer] {
switch self {
case .List(let list):
var xmlList = [XMLIndexer]()
for elem in list {
xmlList.append(XMLIndexer(elem))
}
return xmlList
case .Element(let elem):
return [XMLIndexer(elem)]
case .Stream(let ops):
let list = ops.findElements()
return list.all
default:
return []
}
}
/// All child elements from the currently indexed level
public var children: [XMLIndexer] {
var list = [XMLIndexer]()
for elem in all.map({ $0.element! }).flatMap({ $0 }) {
for elem in elem.xmlChildren {
list.append(XMLIndexer(elem))
}
}
return list
}
/**
Allows for element lookup by matching attribute values.
- parameters:
- attr: should the name of the attribute to match on
- value: should be the value of the attribute to match on
- throws: an XMLIndexer.XMLError if an element with the specified attribute isn't found
- returns: instance of XMLIndexer
*/
public func withAttr(_ attr: String, _ value: String) throws -> XMLIndexer {
switch self {
case .Stream(let opStream):
let match = opStream.findElements()
return try match.withAttr(attr, value)
case .List(let list):
if let elem = list.filter({$0.attribute(by: attr)?.text == value}).first {
return .Element(elem)
}
throw IndexingError.AttributeValue(attr: attr, value: value)
case .Element(let elem):
if elem.attribute(by: attr)?.text == value {
return .Element(elem)
}
throw IndexingError.AttributeValue(attr: attr, value: value)
default:
throw IndexingError.Attribute(attr: attr)
}
}
/**
Initializes the XMLIndexer
- parameter _: should be an instance of XMLElement, but supports other values for error handling
- throws: an Error if the object passed in isn't an XMLElement or LaxyXMLParser
*/
public init(_ rawObject: AnyObject) throws {
switch rawObject {
case let value as XMLElement:
self = .Element(value)
case let value as LazyXMLParser:
self = .Stream(IndexOps(parser: value))
default:
throw IndexingError.Init(instance: rawObject)
}
}
/**
Initializes the XMLIndexer
- parameter _: an instance of XMLElement
*/
public init(_ elem: XMLElement) {
self = .Element(elem)
}
init(_ stream: LazyXMLParser) {
self = .Stream(IndexOps(parser: stream))
}
/**
Find an XML element at the current level by element name
- parameter key: The element name to index by
- returns: instance of XMLIndexer to match the element (or elements) found by key
- throws: Throws an XMLIndexerError.Key if no element was found
*/
public func byKey(_ key: String) throws -> XMLIndexer {
switch self {
case .Stream(let opStream):
let op = IndexOp(key)
opStream.ops.append(op)
return .Stream(opStream)
case .Element(let elem):
let match = elem.xmlChildren.filter({ $0.name == key })
if !match.isEmpty {
if match.count == 1 {
return .Element(match[0])
} else {
return .List(match)
}
}
fallthrough
default:
throw IndexingError.Key(key: key)
}
}
/**
Find an XML element at the current level by element name
- parameter key: The element name to index by
- returns: instance of XMLIndexer to match the element (or elements) found by
*/
public subscript(key: String) -> XMLIndexer {
do {
return try self.byKey(key)
} catch let error as IndexingError {
return .XMLError(error)
} catch {
return .XMLError(IndexingError.Key(key: key))
}
}
/**
Find an XML element by index within a list of XML Elements at the current level
- parameter index: The 0-based index to index by
- throws: XMLIndexer.XMLError if the index isn't found
- returns: instance of XMLIndexer to match the element (or elements) found by index
*/
public func byIndex(_ index: Int) throws -> XMLIndexer {
switch self {
case .Stream(let opStream):
opStream.ops[opStream.ops.count - 1].index = index
return .Stream(opStream)
case .List(let list):
if index <= list.count {
return .Element(list[index])
}
return .XMLError(IndexingError.Index(idx: index))
case .Element(let elem):
if index == 0 {
return .Element(elem)
}
fallthrough
default:
return .XMLError(IndexingError.Index(idx: index))
}
}
/**
Find an XML element by index
- parameter index: The 0-based index to index by
- returns: instance of XMLIndexer to match the element (or elements) found by index
*/
public subscript(index: Int) -> XMLIndexer {
do {
return try byIndex(index)
} catch let error as IndexingError {
return .XMLError(error)
} catch {
return .XMLError(IndexingError.Index(idx: index))
}
}
typealias GeneratorType = XMLIndexer
/**
Method to iterate (for-in) over the `all` collection
- returns: an array of `XMLIndexer` instances
*/
public func makeIterator() -> IndexingIterator<[XMLIndexer]> {
return all.makeIterator()
}
}
/// XMLIndexer extensions
/*
extension XMLIndexer: Boolean {
/// True if a valid XMLIndexer, false if an error type
public var boolValue: Bool {
switch self {
case .XMLError:
return false
default:
return true
}
}
}
*/
extension XMLIndexer: CustomStringConvertible {
/// The XML representation of the XMLIndexer at the current level
public var description: String {
switch self {
case .List(let list):
return list.map { $0.description }.joined(separator: "")
case .Element(let elem):
if elem.name == rootElementName {
return elem.children.map { $0.description }.joined(separator: "")
}
return elem.description
default:
return ""
}
}
}
extension IndexingError: CustomStringConvertible {
/// The description for the `XMLIndexer.Error`.
public var description: String {
switch self {
case .Attribute(let attr):
return "XML Attribute Error: Missing attribute [\"\(attr)\"]"
case .AttributeValue(let attr, let value):
return "XML Attribute Error: Missing attribute [\"\(attr)\"] with value [\"\(value)\"]"
case .Key(let key):
return "XML Element Error: Incorrect key [\"\(key)\"]"
case .Index(let index):
return "XML Element Error: Incorrect index [\"\(index)\"]"
case .Init(let instance):
return "XML Indexer Error: initialization with Object [\"\(instance)\"]"
case .Error:
return "Unknown Error"
}
}
}
/// Models content for an XML doc, whether it is text or XML
public protocol XMLContent: CustomStringConvertible { }
/// Models a text element
public class TextElement: XMLContent {
/// The underlying text value
public let text: String
init(text: String) {
self.text = text
}
}
public struct XMLAttribute {
public let name: String
public let text: String
init(name: String, text: String) {
self.name = name
self.text = text
}
}
/// Models an XML element, including name, text and attributes
public class XMLElement: XMLContent {
/// The name of the element
public let name: String
/// The attributes of the element
@available(*, deprecated, message: "See `allAttributes` instead, which introduces the XMLAttribute type over a simple String type")
public var attributes: [String:String] {
var attrMap = [String: String]()
for (name, attr) in allAttributes {
attrMap[name] = attr.text
}
return attrMap
}
public var allAttributes = [String:XMLAttribute]()
public func attribute(by name: String) -> XMLAttribute? {
return allAttributes[name]
}
/// The inner text of the element, if it exists
public var text: String? {
return children
.map({ $0 as? TextElement })
.flatMap({ $0 })
.reduce("", { $0 + $1!.text })
}
/// All child elements (text or XML)
public var children = [XMLContent]()
var count: Int = 0
var index: Int
var xmlChildren: [XMLElement] {
return children.map { $0 as? XMLElement }.flatMap { $0 }
}
/**
Initialize an XMLElement instance
- parameters:
- name: The name of the element to be initialized
- index: The index of the element to be initialized
*/
init(name: String, index: Int = 0) {
self.name = name
self.index = index
}
/**
Adds a new XMLElement underneath this instance of XMLElement
- parameters:
- name: The name of the new element to be added
- withAttributes: The attributes dictionary for the element being added
- returns: The XMLElement that has now been added
*/
func addElement(_ name: String, withAttributes attributes: NSDictionary) -> XMLElement {
let element = XMLElement(name: name, index: count)
count += 1
children.append(element)
for (keyAny, valueAny) in attributes {
if let key = keyAny as? String,
let value = valueAny as? String {
element.allAttributes[key] = XMLAttribute(name: key, text: value)
}
}
return element
}
func addText(_ text: String) {
let elem = TextElement(text: text)
children.append(elem)
}
}
extension TextElement: CustomStringConvertible {
/// The text value for a `TextElement` instance.
public var description: String {
return text
}
}
extension XMLAttribute: CustomStringConvertible {
/// The textual representation of an `XMLAttribute` instance.
public var description: String {
return "\(name)=\"\(text)\""
}
}
extension XMLElement: CustomStringConvertible {
/// The tag, attributes and content for a `XMLElement` instance (content)
public var description: String {
var attributesString = allAttributes.map { $0.1.description }.joined(separator: " ")
if !attributesString.isEmpty {
attributesString = " " + attributesString
}
if !children.isEmpty {
var xmlReturn = [String]()
xmlReturn.append("<\(name)\(attributesString)>")
for child in children {
xmlReturn.append(child.description)
}
xmlReturn.append("\(name)>")
return xmlReturn.joined(separator: "")
}
if text != nil {
return "<\(name)\(attributesString)>\(text!)\(name)>"
} else {
return "<\(name)\(attributesString)/>"
}
}
}
// Workaround for "'XMLElement' is ambiguous for type lookup in this context" error on macOS.
//
// On macOS, `XMLElement` is defined in Foundation.
// So, the code referencing `XMLElement` generates above error.
// Following code allow to using `SWXMLhash.XMLElement` in client codes.
extension SWXMLHash {
public typealias XMLElement = SWXMLHashXMLElement
}
public typealias SWXMLHashXMLElement = XMLElement
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/LinuxMain.swift
================================================
import XCTest
@testable import SWXMLHashTests
XCTMain([
testCase(LazyTypesConversionTests.allTests),
testCase(LazyWhiteSpaceParsingTests.allTests),
testCase(LazyXMLParsingTests.allTests),
testCase(MixedTextWithXMLElementsTests.allTests),
testCase(SWXMLHashConfigTests.allTests),
testCase(TypeConversionArrayOfNonPrimitiveTypesTests.allTests),
testCase(TypeConversionBasicTypesTests.allTests),
testCase(TypeConversionComplexTypesTests.allTests),
testCase(TypeConversionPrimitypeTypesTests.allTests),
testCase(WhiteSpaceParsingTests.allTests),
testCase(XMLParsingTests.allTests),
])
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
${EXECUTABLE_NAME}
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
${PRODUCT_NAME}
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
1
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/LazyTypesConversionTests.swift
================================================
//
// LazyTypesConversionTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
// swiftlint:disable force_try
class LazyTypesConversionTests: XCTestCase {
var parser: XMLIndexer?
let xmlWithBasicTypes = "" +
" the string value" +
" 100" +
" 100.45" +
" 44.12" +
" 0" +
" true" +
" " +
" " +
" the name of basic item" +
" 99.14" +
" " +
" " +
""
override func setUp() {
parser = SWXMLHash.config { cfg in cfg.shouldProcessLazily = true }.parse(xmlWithBasicTypes)
}
func testShouldConvertValueToNonOptional() {
do {
let value: String = try parser!["root"]["string"].value()
XCTAssertEqual(value, "the string value")
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertAttributeToNonOptional() {
do {
let value: Int = try parser!["root"]["attribute"].value(ofAttribute: "int")
XCTAssertEqual(value, 1)
} catch {
XCTFail("\(error)")
}
}
}
extension LazyTypesConversionTests {
static var allTests: [(String, (LazyTypesConversionTests) -> () throws -> Void)] {
return [
("testShouldConvertValueToNonOptional", testShouldConvertValueToNonOptional),
("testShouldConvertAttributeToNonOptional", testShouldConvertAttributeToNonOptional),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/LazyWhiteSpaceParsingTests.swift
================================================
//
// LazyWhiteSpaceParsingTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import SWXMLHash
import XCTest
// swiftlint:disable line_length
// swiftlint:disable force_try
class LazyWhiteSpaceParsingTests: XCTestCase {
var xml: XMLIndexer?
override func setUp() {
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"])
#else
let bundle = Bundle(for: WhiteSpaceParsingTests.self)
let path = bundle.path(forResource: "test", ofType: "xml")!
#endif
let data = try! Data(contentsOf: URL(fileURLWithPath: path))
xml = SWXMLHash.lazy(data)
}
// issue #6
func testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace() {
XCTAssertEqual(xml!["niotemplate"]["section"][0]["constraint"][1].element?.text, "H:|-15-[title]-15-|")
}
func testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace() {
XCTAssertEqual(xml!["niotemplate"]["other"].element?.text, "\n \n this\n has\n white\n space\n \n ")
}
}
extension LazyWhiteSpaceParsingTests {
static var allTests: [(String, (LazyWhiteSpaceParsingTests) -> () throws -> Void)] {
return [
("testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace", testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace),
("testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace", testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/LazyXMLParsingTests.swift
================================================
//
// LazyXMLParsingTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
// swiftlint:disable force_try
// swiftlint:disable line_length
class LazyXMLParsingTests: XCTestCase {
let xmlToParse = "header mixed contentTest Title Headermore mixed contentGambardella, MatthewXML Developer's GuideComputer44.952000-10-01An in-depth look at creating applications with XML.Ralls, KimMidnight RainFantasy5.952000-12-16A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.Corets, EvaMaeve AscendantFantasy5.952000-11-17After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society."
var xml: XMLIndexer?
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
xml = SWXMLHash.config { config in config.shouldProcessLazily = true }.parse(xmlToParse)
}
func testShouldBeAbleToParseIndividualElements() {
XCTAssertEqual(xml!["root"]["header"]["title"].element?.text, "Test Title Header")
}
func testShouldBeAbleToParseElementGroups() {
XCTAssertEqual(xml!["root"]["catalog"]["book"][1]["author"].element?.text, "Ralls, Kim")
}
func testShouldBeAbleToParseAttributes() {
XCTAssertEqual(xml!["root"]["catalog"]["book"][1].element?.attributes["id"], "bk102")
XCTAssertEqual(xml!["root"]["catalog"]["book"][1].element?.attribute(by: "id")?.text, "bk102")
}
func testShouldBeAbleToLookUpElementsByNameAndAttribute() {
do {
let value = try xml!["root"]["catalog"]["book"].withAttr("id", "bk102")["author"].element?.text
XCTAssertEqual(value, "Ralls, Kim")
} catch {
XCTFail("\(error)")
}
}
func testShouldBeAbleToIterateElementGroups() {
let result = xml!["root"]["catalog"]["book"].all.map({ $0["genre"].element!.text! }).joined(separator: ", ")
XCTAssertEqual(result, "Computer, Fantasy, Fantasy")
}
func testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound() {
XCTAssertEqual(xml!["root"]["header"]["title"].all.count, 1)
}
func testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound() {
XCTAssertEqual(xml!["root"]["header"]["title"][0].element?.text, "Test Title Header")
}
func testShouldBeAbleToIterateUsingForIn() {
var count = 0
for _ in xml!["root"]["catalog"]["book"] {
count += 1
}
XCTAssertEqual(count, 3)
}
func testShouldBeAbleToEnumerateChildren() {
let result = xml!["root"]["catalog"]["book"][0].children.map({ $0.element!.name }).joined(separator: ", ")
XCTAssertEqual(result, "author, title, genre, price, publish_date, description")
}
func testShouldBeAbleToHandleMixedContent() {
XCTAssertEqual(xml!["root"]["header"].element?.text, "header mixed contentmore mixed content")
}
func testShouldHandleInterleavingXMLElements() {
let interleavedXml = "one
two
three
four
"
let parsed = SWXMLHash.parse(interleavedXml)
let result = parsed["html"]["body"].children.map({ $0.element!.text! }).joined(separator: ", ")
XCTAssertEqual(result, "one, two, three, four")
}
func testShouldBeAbleToProvideADescriptionForTheDocument() {
let descriptionXml = "puppies"
let parsed = SWXMLHash.parse(descriptionXml)
XCTAssertEqual(parsed.description, "puppies")
}
// error handling
func testShouldReturnNilWhenKeysDontMatch() {
XCTAssertNil(xml!["root"]["what"]["header"]["foo"].element?.name)
}
}
extension LazyXMLParsingTests {
static var allTests: [(String, (LazyXMLParsingTests) -> () throws -> Void)] {
return [
("testShouldBeAbleToParseIndividualElements", testShouldBeAbleToParseIndividualElements),
("testShouldBeAbleToParseElementGroups", testShouldBeAbleToParseElementGroups),
("testShouldBeAbleToParseAttributes", testShouldBeAbleToParseAttributes),
("testShouldBeAbleToLookUpElementsByNameAndAttribute", testShouldBeAbleToLookUpElementsByNameAndAttribute),
("testShouldBeAbleToIterateElementGroups", testShouldBeAbleToIterateElementGroups),
("testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound", testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound),
("testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound", testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound),
("testShouldBeAbleToIterateUsingForIn", testShouldBeAbleToIterateUsingForIn),
("testShouldBeAbleToEnumerateChildren", testShouldBeAbleToEnumerateChildren),
("testShouldBeAbleToHandleMixedContent", testShouldBeAbleToHandleMixedContent),
("testShouldHandleInterleavingXMLElements", testShouldHandleInterleavingXMLElements),
("testShouldBeAbleToProvideADescriptionForTheDocument", testShouldBeAbleToProvideADescriptionForTheDocument),
("testShouldReturnNilWhenKeysDontMatch", testShouldReturnNilWhenKeysDontMatch),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/LinuxShims.swift
================================================
//
// LinuxShims.swift
// SWXMLHash
//
// Created by 野村 憲男 on 8/29/16.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
#if os(Linux)
extension NSString {
class func path(withComponents components: [String]) -> String {
return pathWithComponents(components)
}
}
#endif
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/MixedTextWithXMLElementsTests.swift
================================================
//
// MixedTextWithXMLElementsTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
// swiftlint:disable line_length
class MixedTextWithXMLElementsTests: XCTestCase {
var xml: XMLIndexer?
override func setUp() {
let xmlContent = "Here is a cool thing A and second cool thing B"
xml = SWXMLHash.parse(xmlContent)
}
func testShouldBeAbleToGetAllContentsInsideOfAnElement() {
XCTAssertEqual(xml!["everything"]["news"]["content"].description, "Here is a cool thing A and second cool thing B")
}
}
extension MixedTextWithXMLElementsTests {
static var allTests: [(String, (MixedTextWithXMLElementsTests) -> () throws -> Void)] {
return [
("testShouldBeAbleToGetAllContentsInsideOfAnElement", testShouldBeAbleToGetAllContentsInsideOfAnElement),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/SWXMLHashConfigTests.swift
================================================
//
// SWXMLHashConfigTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
class SWXMLHashConfigTests: XCTestCase {
var parser: XMLIndexer?
let xmlWithNamespace = "" +
" " +
" " +
" Apples" +
" Bananas" +
" " +
" " +
""
override func setUp() {
parser = SWXMLHash.config { conf in
conf.shouldProcessNamespaces = true
}.parse(xmlWithNamespace)
}
func testShouldAllowProcessingNamespacesOrNot() {
XCTAssertEqual(parser!["root"]["table"]["tr"]["td"][0].element?.text, "Apples")
}
}
extension SWXMLHashConfigTests {
static var allTests: [(String, (SWXMLHashConfigTests) -> () throws -> Void)] {
return [
("testShouldAllowProcessingNamespacesOrNot", testShouldAllowProcessingNamespacesOrNot),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/TypeConversionArrayOfNonPrimitiveTypesTests.swift
================================================
//
// TypeConversionArrayOfNonPrimitiveTypesTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
// swiftlint:disable force_try
// swiftlint:disable line_length
// swiftlint:disable type_name
class TypeConversionArrayOfNonPrimitiveTypesTests: XCTestCase {
var parser: XMLIndexer?
let xmlWithArraysOfTypes = "" +
"" +
" " +
" item 1" +
" 1" +
" " +
" " +
" item 2" +
" 2" +
" " +
" " +
" item 3" +
" 3" +
" " +
"" +
"" +
" " +
" item 1" +
" 1" +
" " +
" " + // it's missing the name node
" 2" +
" " +
" " +
" item 3" +
" 3" +
" " +
"" +
"" +
" " +
" " +
" " +
"" +
"" +
" " +
" " + // it's missing the name attribute
" " +
"" +
""
let correctBasicItems = [
BasicItem(name: "item 1", price: 1),
BasicItem(name: "item 2", price: 2),
BasicItem(name: "item 3", price: 3)
]
let correctAttributeItems = [
AttributeItem(name: "attr 1", price: 1.1),
AttributeItem(name: "attr 2", price: 2.2),
AttributeItem(name: "attr 3", price: 3.3)
]
override func setUp() {
parser = SWXMLHash.parse(xmlWithArraysOfTypes)
}
func testShouldConvertArrayOfGoodBasicitemsItemsToNonOptional() {
do {
let value: [BasicItem] = try parser!["root"]["arrayOfGoodBasicItems"]["basicItem"].value()
XCTAssertEqual(value, correctBasicItems)
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertArrayOfGoodBasicitemsItemsToOptional() {
do {
let value: [BasicItem]? = try parser!["root"]["arrayOfGoodBasicItems"]["basicItem"].value()
XCTAssertNotNil(value)
if let value = value {
XCTAssertEqual(value, correctBasicItems)
}
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertArrayOfGoodBasicitemsItemsToArrayOfOptionals() {
do {
let value: [BasicItem?] = try parser!["root"]["arrayOfGoodBasicItems"]["basicItem"].value()
XCTAssertEqual(value.flatMap({ $0 }), correctBasicItems)
} catch {
XCTFail("\(error)")
}
}
func testShouldThrowWhenConvertingArrayOfBadBasicitemsToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadBasicItems"]["basicItem"].value() as [BasicItem])) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfBadBasicitemsToOptional() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadBasicItems"]["basicItem"].value() as [BasicItem]?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfBadBasicitemsToArrayOfOptionals() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadBasicItems"]["basicItem"].value() as [BasicItem?])) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldConvertArrayOfGoodAttributeItemsToNonOptional() {
do {
let value: [AttributeItem] = try parser!["root"]["arrayOfGoodAttributeItems"]["attributeItem"].value()
XCTAssertEqual(value, correctAttributeItems)
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertArrayOfGoodAttributeItemsToOptional() {
do {
let value: [AttributeItem]? = try parser!["root"]["arrayOfGoodAttributeItems"]["attributeItem"].value()
XCTAssertNotNil(value)
if let value = value {
XCTAssertEqual(value, correctAttributeItems)
}
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertArrayOfGoodAttributeItemsToArrayOfOptionals() {
do {
let value: [AttributeItem?] = try parser!["root"]["arrayOfGoodAttributeItems"]["attributeItem"].value()
XCTAssertEqual(value.flatMap({ $0 }), correctAttributeItems)
} catch {
XCTFail("\(error)")
}
}
func testShouldThrowWhenConvertingArrayOfBadAttributeItemsToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadAttributeItems"]["attributeItem"].value() as [AttributeItem])) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfBadAttributeItemsToOptional() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadAttributeItems"]["attributeItem"].value() as [AttributeItem]?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfBadAttributeItemsToArrayOfOptionals() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadAttributeItems"]["attributeItem"].value() as [AttributeItem?])) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
}
extension TypeConversionArrayOfNonPrimitiveTypesTests {
static var allTests: [(String, (TypeConversionArrayOfNonPrimitiveTypesTests) -> () throws -> Void)] {
return [
("testShouldConvertArrayOfGoodBasicitemsItemsToNonOptional", testShouldConvertArrayOfGoodBasicitemsItemsToNonOptional),
("testShouldConvertArrayOfGoodBasicitemsItemsToOptional", testShouldConvertArrayOfGoodBasicitemsItemsToOptional),
("testShouldConvertArrayOfGoodBasicitemsItemsToArrayOfOptionals", testShouldConvertArrayOfGoodBasicitemsItemsToArrayOfOptionals),
("testShouldThrowWhenConvertingArrayOfBadBasicitemsToNonOptional", testShouldThrowWhenConvertingArrayOfBadBasicitemsToNonOptional),
("testShouldThrowWhenConvertingArrayOfBadBasicitemsToOptional", testShouldThrowWhenConvertingArrayOfBadBasicitemsToOptional),
("testShouldThrowWhenConvertingArrayOfBadBasicitemsToArrayOfOptionals", testShouldThrowWhenConvertingArrayOfBadBasicitemsToArrayOfOptionals),
("testShouldConvertArrayOfGoodAttributeItemsToNonOptional", testShouldConvertArrayOfGoodAttributeItemsToNonOptional),
("testShouldConvertArrayOfGoodAttributeItemsToOptional", testShouldConvertArrayOfGoodAttributeItemsToOptional),
("testShouldConvertArrayOfGoodAttributeItemsToArrayOfOptionals", testShouldConvertArrayOfGoodAttributeItemsToArrayOfOptionals),
("testShouldThrowWhenConvertingArrayOfBadAttributeItemsToNonOptional", testShouldThrowWhenConvertingArrayOfBadAttributeItemsToNonOptional),
("testShouldThrowWhenConvertingArrayOfBadAttributeItemsToOptional", testShouldThrowWhenConvertingArrayOfBadAttributeItemsToOptional),
("testShouldThrowWhenConvertingArrayOfBadAttributeItemsToArrayOfOptionals", testShouldThrowWhenConvertingArrayOfBadAttributeItemsToArrayOfOptionals),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/TypeConversionBasicTypesTests.swift
================================================
//
// TypesConversionBasicTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
// swiftlint:disable force_try
// swiftlint:disable variable_name
class TypeConversionBasicTypesTests: XCTestCase {
var parser: XMLIndexer?
let xmlWithBasicTypes = "" +
" the string value" +
" 100" +
" 100.45" +
" 44.12" +
" 0" +
" true" +
" " +
" " +
" the name of basic item" +
" 99.14" +
" " +
" " +
" " +
""
override func setUp() {
parser = SWXMLHash.parse(xmlWithBasicTypes)
}
func testShouldConvertValueToNonOptional() {
do {
let value: String = try parser!["root"]["string"].value()
XCTAssertEqual(value, "the string value")
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertEmptyToNonOptional() {
do {
let value: String = try parser!["root"]["empty"].value()
XCTAssertEqual(value, "")
} catch {
XCTFail("\(error)")
}
}
func testShouldThrowWhenConvertingMissingToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["missing"].value() as String)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldConvertValueToOptional() {
do {
let value: String? = try parser!["root"]["string"].value()
XCTAssertEqual(value, "the string value")
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertEmptyToOptional() {
do {
let value: String? = try parser!["root"]["empty"].value()
XCTAssertEqual(value, "")
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertMissingToOptional() {
do {
let value: String? = try parser!["root"]["missing"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertAttributeToNonOptional() {
do {
let value: String = try parser!["root"]["attr"].value(ofAttribute: "string")
XCTAssertEqual(value, "stringValue")
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertAttributeToOptional() {
let value: String? = parser!["root"]["attr"].value(ofAttribute: "string")
XCTAssertEqual(value, "stringValue")
}
func testShouldThrowWhenConvertingMissingAttributeToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["attr"].value(ofAttribute: "missing") as String)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldConvertMissingAttributeToOptional() {
let value: String? = parser!["root"]["attr"].value(ofAttribute: "missing")
XCTAssertNil(value)
}
func testIntShouldConvertValueToNonOptional() {
do {
let value: Int = try parser!["root"]["int"].value()
XCTAssertEqual(value, 100)
} catch {
XCTFail("\(error)")
}
}
func testIntShouldThrowWhenConvertingEmptyToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Int)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testIntShouldThrowWhenConvertingMissingToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["missing"].value() as Int)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testIntShouldConvertValueToOptional() {
do {
let value: Int? = try parser!["root"]["int"].value()
XCTAssertEqual(value, 100)
} catch {
XCTFail("\(error)")
}
}
func testIntShouldConvertEmptyToOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Int?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testIntShouldConvertMissingToOptional() {
do {
let value: Int? = try parser!["root"]["missing"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
func testIntShouldConvertAttributeToNonOptional() {
do {
let value: Int = try parser!["root"]["attr"].value(ofAttribute: "int")
XCTAssertEqual(value, 200)
} catch {
XCTFail("\(error)")
}
}
func testIntShouldConvertAttributeToOptional() {
let value: Int? = parser!["root"]["attr"].value(ofAttribute: "int")
XCTAssertEqual(value, 200)
}
func testDoubleShouldConvertValueToNonOptional() {
do {
let value: Double = try parser!["root"]["double"].value()
XCTAssertEqual(value, 100.45)
} catch {
XCTFail("\(error)")
}
}
func testDoubleShouldThrowWhenConvertingEmptyToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Double)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testDoubleShouldThrowWhenConvertingMissingToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["missing"].value() as Double)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testDoubleShouldConvertValueToOptional() {
do {
let value: Double? = try parser!["root"]["double"].value()
XCTAssertEqual(value, 100.45)
} catch {
XCTFail("\(error)")
}
}
func testDoubleShouldConvertEmptyToOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Double?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testDoubleShouldConvertMissingToOptional() {
do {
let value: Double? = try parser!["root"]["missing"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
func testDoubleShouldConvertAttributeToNonOptional() {
do {
let value: Double = try parser!["root"]["attr"].value(ofAttribute: "double")
XCTAssertEqual(value, 200.15)
} catch {
XCTFail("\(error)")
}
}
func testDoubleShouldConvertAttributeToOptional() {
let value: Double? = parser!["root"]["attr"].value(ofAttribute: "double")
XCTAssertEqual(value, 200.15)
}
func testFloatShouldConvertValueToNonOptional() {
do {
let value: Float = try parser!["root"]["float"].value()
XCTAssertEqual(value, 44.12)
} catch {
XCTFail("\(error)")
}
}
func testFloatShouldThrowWhenConvertingEmptyToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Float)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testFloatShouldThrowWhenConvertingMissingToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["missing"].value() as Float)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testFloatShouldConvertValueToOptional() {
do {
let value: Float? = try parser!["root"]["float"].value()
XCTAssertEqual(value, 44.12)
} catch {
XCTFail("\(error)")
}
}
func testFloatShouldConvertEmptyToOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Float?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testFloatShouldConvertMissingToOptional() {
do {
let value: Float? = try parser!["root"]["missing"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
func testFloatShouldConvertAttributeToNonOptional() {
do {
let value: Float = try parser!["root"]["attr"].value(ofAttribute: "float")
XCTAssertEqual(value, 205.42)
} catch {
XCTFail("\(error)")
}
}
func testFloatShouldConvertAttributeToOptional() {
let value: Float? = parser!["root"]["attr"].value(ofAttribute: "float")
XCTAssertEqual(value, 205.42)
}
func testBoolShouldConvertValueToNonOptional() {
do {
let value1: Bool = try parser!["root"]["bool1"].value()
let value2: Bool = try parser!["root"]["bool2"].value()
XCTAssertFalse(value1)
XCTAssertTrue(value2)
} catch {
XCTFail("\(error)")
}
}
func testBoolShouldThrowWhenConvertingEmptyToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Bool)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testBoolShouldThrowWhenConvertingMissingToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["missing"].value() as Bool)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testBoolShouldConvertValueToOptional() {
do {
let value1: Bool? = try parser!["root"]["bool1"].value()
XCTAssertEqual(value1, false)
let value2: Bool? = try parser!["root"]["bool2"].value()
XCTAssertEqual(value2, true)
} catch {
XCTFail("\(error)")
}
}
func testBoolShouldConvertEmptyToOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Bool?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testBoolShouldConvertMissingToOptional() {
do {
let value: Bool? = try parser!["root"]["missing"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
func testBoolShouldConvertAttributeToNonOptional() {
do {
let value: Bool = try parser!["root"]["attr"].value(ofAttribute: "bool1")
XCTAssertEqual(value, false)
} catch {
XCTFail("\(error)")
}
}
func testBoolShouldConvertAttributeToOptional() {
let value: Bool? = parser!["root"]["attr"].value(ofAttribute: "bool2")
XCTAssertEqual(value, true)
}
let correctBasicItem = BasicItem(name: "the name of basic item", price: 99.14)
func testBasicItemShouldConvertBasicitemToNonOptional() {
do {
let value: BasicItem = try parser!["root"]["basicItem"].value()
XCTAssertEqual(value, correctBasicItem)
} catch {
XCTFail("\(error)")
}
}
func testBasicItemShouldThrowWhenConvertingEmptyToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as BasicItem)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testBasicItemShouldThrowWhenConvertingMissingToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["missing"].value() as BasicItem)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testBasicItemShouldConvertBasicitemToOptional() {
do {
let value: BasicItem? = try parser!["root"]["basicItem"].value()
XCTAssertEqual(value, correctBasicItem)
} catch {
XCTFail("\(error)")
}
}
func testBasicItemShouldConvertEmptyToOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as BasicItem?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testBasicItemShouldConvertMissingToOptional() {
do {
let value: BasicItem? = try parser!["root"]["missing"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
let correctAttributeItem = AttributeItem(name: "the name of attribute item", price: 19.99)
func testAttributeItemShouldConvertAttributeItemToNonOptional() {
do {
let value: AttributeItem = try parser!["root"]["attributeItem"].value()
XCTAssertEqual(value, correctAttributeItem)
} catch {
XCTFail("\(error)")
}
}
func testAttributeItemShouldThrowWhenConvertingEmptyToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as AttributeItem)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testAttributeItemShouldThrowWhenConvertingMissingToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["missing"].value() as AttributeItem)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testAttributeItemShouldConvertAttributeItemToOptional() {
do {
let value: AttributeItem? = try parser!["root"]["attributeItem"].value()
XCTAssertEqual(value, correctAttributeItem)
} catch {
XCTFail("\(error)")
}
}
func testAttributeItemShouldConvertEmptyToOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as AttributeItem?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testAttributeItemShouldConvertMissingToOptional() {
do {
let value: AttributeItem? = try parser!["root"]["missing"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
}
struct BasicItem: XMLIndexerDeserializable {
let name: String
let price: Double
static func deserialize(_ node: XMLIndexer) throws -> BasicItem {
return try BasicItem(
name: node["name"].value(),
price: node["price"].value()
)
}
}
extension BasicItem: Equatable {}
func == (a: BasicItem, b: BasicItem) -> Bool {
return a.name == b.name && a.price == b.price
}
struct AttributeItem: XMLElementDeserializable {
let name: String
let price: Double
static func deserialize(_ element: SWXMLHash.XMLElement) throws -> AttributeItem {
return try AttributeItem(
name: element.value(ofAttribute: "name"),
price: element.value(ofAttribute: "price")
)
}
}
extension AttributeItem: Equatable {}
func == (a: AttributeItem, b: AttributeItem) -> Bool {
return a.name == b.name && a.price == b.price
}
extension TypeConversionBasicTypesTests {
static var allTests: [(String, (TypeConversionBasicTypesTests) -> () throws -> Void)] {
return [
("testShouldConvertValueToNonOptional", testShouldConvertValueToNonOptional),
("testShouldConvertEmptyToNonOptional", testShouldConvertEmptyToNonOptional),
("testShouldThrowWhenConvertingMissingToNonOptional", testShouldThrowWhenConvertingMissingToNonOptional),
("testShouldConvertValueToOptional", testShouldConvertValueToOptional),
("testShouldConvertEmptyToOptional", testShouldConvertEmptyToOptional),
("testShouldConvertMissingToOptional", testShouldConvertMissingToOptional),
("testShouldConvertAttributeToNonOptional", testShouldConvertAttributeToNonOptional),
("testShouldConvertAttributeToOptional", testShouldConvertAttributeToOptional),
("testShouldThrowWhenConvertingMissingAttributeToNonOptional", testShouldThrowWhenConvertingMissingAttributeToNonOptional),
("testShouldConvertMissingAttributeToOptional", testShouldConvertMissingAttributeToOptional),
("testIntShouldConvertValueToNonOptional", testIntShouldConvertValueToNonOptional),
("testIntShouldThrowWhenConvertingEmptyToNonOptional", testIntShouldThrowWhenConvertingEmptyToNonOptional),
("testIntShouldThrowWhenConvertingMissingToNonOptional", testIntShouldThrowWhenConvertingMissingToNonOptional),
("testIntShouldConvertValueToOptional", testIntShouldConvertValueToOptional),
("testIntShouldConvertEmptyToOptional", testIntShouldConvertEmptyToOptional),
("testIntShouldConvertMissingToOptional", testIntShouldConvertMissingToOptional),
("testIntShouldConvertAttributeToNonOptional", testIntShouldConvertAttributeToNonOptional),
("testIntShouldConvertAttributeToOptional", testIntShouldConvertAttributeToOptional),
("testDoubleShouldConvertValueToNonOptional", testDoubleShouldConvertValueToNonOptional),
("testDoubleShouldThrowWhenConvertingEmptyToNonOptional", testDoubleShouldThrowWhenConvertingEmptyToNonOptional),
("testDoubleShouldThrowWhenConvertingMissingToNonOptional", testDoubleShouldThrowWhenConvertingMissingToNonOptional),
("testDoubleShouldConvertValueToOptional", testDoubleShouldConvertValueToOptional),
("testDoubleShouldConvertEmptyToOptional", testDoubleShouldConvertEmptyToOptional),
("testDoubleShouldConvertMissingToOptional", testDoubleShouldConvertMissingToOptional),
("testDoubleShouldConvertAttributeToNonOptional", testDoubleShouldConvertAttributeToNonOptional),
("testDoubleShouldConvertAttributeToOptional", testDoubleShouldConvertAttributeToOptional),
("testFloatShouldConvertValueToNonOptional", testFloatShouldConvertValueToNonOptional),
("testFloatShouldThrowWhenConvertingEmptyToNonOptional", testFloatShouldThrowWhenConvertingEmptyToNonOptional),
("testFloatShouldThrowWhenConvertingMissingToNonOptional", testFloatShouldThrowWhenConvertingMissingToNonOptional),
("testFloatShouldConvertValueToOptional", testFloatShouldConvertValueToOptional),
("testFloatShouldConvertEmptyToOptional", testFloatShouldConvertEmptyToOptional),
("testFloatShouldConvertMissingToOptional", testFloatShouldConvertMissingToOptional),
("testFloatShouldConvertAttributeToNonOptional", testFloatShouldConvertAttributeToNonOptional),
("testFloatShouldConvertAttributeToOptional", testFloatShouldConvertAttributeToOptional),
("testBoolShouldConvertValueToNonOptional", testBoolShouldConvertValueToNonOptional),
("testBoolShouldThrowWhenConvertingEmptyToNonOptional", testBoolShouldThrowWhenConvertingEmptyToNonOptional),
("testBoolShouldThrowWhenConvertingMissingToNonOptional", testBoolShouldThrowWhenConvertingMissingToNonOptional),
("testBoolShouldConvertValueToOptional", testBoolShouldConvertValueToOptional),
("testBoolShouldConvertEmptyToOptional", testBoolShouldConvertEmptyToOptional),
("testBoolShouldConvertMissingToOptional", testBoolShouldConvertMissingToOptional),
("testBoolShouldConvertAttributeToNonOptional", testBoolShouldConvertAttributeToNonOptional),
("testBoolShouldConvertAttributeToOptional", testBoolShouldConvertAttributeToOptional),
("testBasicItemShouldConvertBasicitemToNonOptional", testBasicItemShouldConvertBasicitemToNonOptional),
("testBasicItemShouldThrowWhenConvertingEmptyToNonOptional", testBasicItemShouldThrowWhenConvertingEmptyToNonOptional),
("testBasicItemShouldThrowWhenConvertingMissingToNonOptional", testBasicItemShouldThrowWhenConvertingMissingToNonOptional),
("testBasicItemShouldConvertBasicitemToOptional", testBasicItemShouldConvertBasicitemToOptional),
("testBasicItemShouldConvertEmptyToOptional", testBasicItemShouldConvertEmptyToOptional),
("testBasicItemShouldConvertMissingToOptional", testBasicItemShouldConvertMissingToOptional),
("testAttributeItemShouldConvertAttributeItemToNonOptional", testAttributeItemShouldConvertAttributeItemToNonOptional),
("testAttributeItemShouldThrowWhenConvertingEmptyToNonOptional", testAttributeItemShouldThrowWhenConvertingEmptyToNonOptional),
("testAttributeItemShouldThrowWhenConvertingMissingToNonOptional", testAttributeItemShouldThrowWhenConvertingMissingToNonOptional),
("testAttributeItemShouldConvertAttributeItemToOptional", testAttributeItemShouldConvertAttributeItemToOptional),
("testAttributeItemShouldConvertEmptyToOptional", testAttributeItemShouldConvertEmptyToOptional),
("testAttributeItemShouldConvertMissingToOptional", testAttributeItemShouldConvertMissingToOptional),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/TypeConversionComplexTypesTests.swift
================================================
//
// TypeConversionComplexTypesTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
// swiftlint:disable force_try
// swiftlint:disable variable_name
class TypeConversionComplexTypesTests: XCTestCase {
var parser: XMLIndexer?
let xmlWithComplexType = "" +
" " +
" the name of complex item" +
" 1024" +
" " +
" " +
" item 1" +
" 1" +
" " +
" " +
" item 2" +
" 2" +
" " +
" " +
" item 3" +
" 3" +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
""
let correctComplexItem = ComplexItem(
name: "the name of complex item",
priceOptional: 1024,
basics: [
BasicItem(name: "item 1", price: 1),
BasicItem(name: "item 2", price: 2),
BasicItem(name: "item 3", price: 3),
],
attrs: [
AttributeItem(name: "attr1", price: 1.1),
AttributeItem(name: "attr2", price: 2.2),
AttributeItem(name: "attr3", price: 3.3),
]
)
override func setUp() {
parser = SWXMLHash.parse(xmlWithComplexType)
}
func testShouldConvertComplexitemToNonOptional() {
do {
let value: ComplexItem = try parser!["root"]["complexItem"].value()
XCTAssertEqual(value, correctComplexItem)
} catch {
XCTFail("\(error)")
}
}
func testShouldThrowWhenConvertingEmptyToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as ComplexItem)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingMissingToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["missing"].value() as ComplexItem)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldConvertComplexitemToOptional() {
do {
let value: ComplexItem? = try parser!["root"]["complexItem"].value()
XCTAssertEqual(value, correctComplexItem)
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertEmptyToOptional() {
XCTAssertThrowsError(try (parser!["root"]["empty"].value() as ComplexItem?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldConvertMissingToOptional() {
do {
let value: ComplexItem? = try parser!["root"]["missing"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
}
struct ComplexItem: XMLIndexerDeserializable {
let name: String
let priceOptional: Double?
let basics: [BasicItem]
let attrs: [AttributeItem]
static func deserialize(_ node: XMLIndexer) throws -> ComplexItem {
return try ComplexItem(
name: node["name"].value(),
priceOptional: node["price"].value(),
basics: node["basicItems"]["basicItem"].value(),
attrs: node["attributeItems"]["attributeItem"].value()
)
}
}
extension ComplexItem: Equatable {}
func == (a: ComplexItem, b: ComplexItem) -> Bool {
return a.name == b.name && a.priceOptional == b.priceOptional && a.basics == b.basics && a.attrs == b.attrs
}
extension TypeConversionComplexTypesTests {
static var allTests: [(String, (TypeConversionComplexTypesTests) -> () throws -> Void)] {
return [
("testShouldConvertComplexitemToNonOptional", testShouldConvertComplexitemToNonOptional),
("testShouldThrowWhenConvertingEmptyToNonOptional", testShouldThrowWhenConvertingEmptyToNonOptional),
("testShouldThrowWhenConvertingMissingToNonOptional", testShouldThrowWhenConvertingMissingToNonOptional),
("testShouldConvertComplexitemToOptional", testShouldConvertComplexitemToOptional),
("testShouldConvertEmptyToOptional", testShouldConvertEmptyToOptional),
("testShouldConvertMissingToOptional", testShouldConvertMissingToOptional),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/TypeConversionPrimitypeTypesTests.swift
================================================
//
// TypeConversionPrimitypeTypesTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
// swiftlint:disable force_try
// swiftlint:disable line_length
class TypeConversionPrimitypeTypesTests: XCTestCase {
var parser: XMLIndexer?
let xmlWithArraysOfTypes = "" +
"" +
" 0 1 2 3" +
"" +
"" +
" boom" +
"" +
"" +
" 0 boom 2 3" +
"" +
"" +
" " +
"" +
"" +
""
override func setUp() {
parser = SWXMLHash.parse(xmlWithArraysOfTypes)
}
func testShouldConvertArrayOfGoodIntsToNonOptional() {
do {
let value: [Int] = try parser!["root"]["arrayOfGoodInts"]["int"].value()
XCTAssertEqual(value, [0, 1, 2, 3])
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertArrayOfGoodIntsToOptional() {
do {
let value: [Int]? = try parser!["root"]["arrayOfGoodInts"]["int"].value()
XCTAssertNotNil(value)
if let value = value {
XCTAssertEqual(value, [0, 1, 2, 3])
}
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertArrayOfGoodIntsToArrayOfOptionals() {
do {
let value: [Int?] = try parser!["root"]["arrayOfGoodInts"]["int"].value()
XCTAssertEqual(value.flatMap({ $0 }), [0, 1, 2, 3])
} catch {
XCTFail("\(error)")
}
}
func testShouldThrowWhenConvertingArrayOfBadIntsToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadInts"]["int"].value() as [Int])) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfBadIntsToOptional() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadInts"]["int"].value() as [Int]?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfBadIntsToArrayOfOptionals() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfBadInts"]["int"].value() as [Int?])) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfMixedIntsToNonOptional() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfMixedInts"]["int"].value() as [Int])) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfMixedIntsToOptional() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfMixedInts"]["int"].value() as [Int]?)) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldThrowWhenConvertingArrayOfMixedIntsToArrayOfOptionals() {
XCTAssertThrowsError(try (parser!["root"]["arrayOfMixedInts"]["int"].value() as [Int?])) { error in
guard error is XMLDeserializationError else {
XCTFail("Wrong type of error")
return
}
}
}
func testShouldConvertArrayOfAttributeIntsToNonOptional() {
do {
let value: [Int] = try parser!["root"]["arrayOfAttributeInts"]["int"].value(ofAttribute: "value")
XCTAssertEqual(value, [0, 1, 2, 3])
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertArrayOfAttributeIntsToOptional() {
do {
let value: [Int]? = try parser!["root"]["arrayOfAttributeInts"]["int"].value(ofAttribute: "value")
XCTAssertNotNil(value)
if let value = value {
XCTAssertEqual(value, [0, 1, 2, 3])
}
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertArrayOfAttributeIntsToArrayOfOptionals() {
do {
let value: [Int?] = try parser!["root"]["arrayOfAttributeInts"]["int"].value(ofAttribute: "value")
XCTAssertEqual(value.flatMap({ $0 }), [0, 1, 2, 3])
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertEmptyArrayOfIntsToNonOptional() {
do {
let value: [Int] = try parser!["root"]["empty"]["int"].value()
XCTAssertEqual(value, [])
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertEmptyArrayOfIntsToOptional() {
do {
let value: [Int]? = try parser!["root"]["empty"]["int"].value()
XCTAssertNil(value)
} catch {
XCTFail("\(error)")
}
}
func testShouldConvertEmptyArrayOfIntsToArrayOfOptionals() {
do {
let value: [Int?] = try parser!["root"]["empty"]["int"].value()
XCTAssertEqual(value.count, 0)
} catch {
XCTFail("\(error)")
}
}
}
extension TypeConversionPrimitypeTypesTests {
static var allTests: [(String, (TypeConversionPrimitypeTypesTests) -> () throws -> Void)] {
return [
("testShouldConvertArrayOfGoodIntsToNonOptional", testShouldConvertArrayOfGoodIntsToNonOptional),
("testShouldConvertArrayOfGoodIntsToOptional", testShouldConvertArrayOfGoodIntsToOptional),
("testShouldConvertArrayOfGoodIntsToArrayOfOptionals", testShouldConvertArrayOfGoodIntsToArrayOfOptionals),
("testShouldThrowWhenConvertingArrayOfBadIntsToNonOptional", testShouldThrowWhenConvertingArrayOfBadIntsToNonOptional),
("testShouldThrowWhenConvertingArrayOfBadIntsToOptional", testShouldThrowWhenConvertingArrayOfBadIntsToOptional),
("testShouldThrowWhenConvertingArrayOfBadIntsToArrayOfOptionals", testShouldThrowWhenConvertingArrayOfBadIntsToArrayOfOptionals),
("testShouldThrowWhenConvertingArrayOfMixedIntsToNonOptional", testShouldThrowWhenConvertingArrayOfMixedIntsToNonOptional),
("testShouldThrowWhenConvertingArrayOfMixedIntsToOptional", testShouldThrowWhenConvertingArrayOfMixedIntsToOptional),
("testShouldThrowWhenConvertingArrayOfMixedIntsToArrayOfOptionals", testShouldThrowWhenConvertingArrayOfMixedIntsToArrayOfOptionals),
("testShouldConvertArrayOfAttributeIntsToNonOptional", testShouldConvertArrayOfAttributeIntsToNonOptional),
("testShouldConvertArrayOfAttributeIntsToOptional", testShouldConvertArrayOfAttributeIntsToOptional),
("testShouldConvertArrayOfAttributeIntsToArrayOfOptionals", testShouldConvertArrayOfAttributeIntsToArrayOfOptionals),
("testShouldConvertEmptyArrayOfIntsToNonOptional", testShouldConvertEmptyArrayOfIntsToNonOptional),
("testShouldConvertEmptyArrayOfIntsToOptional", testShouldConvertEmptyArrayOfIntsToOptional),
("testShouldConvertEmptyArrayOfIntsToArrayOfOptionals", testShouldConvertEmptyArrayOfIntsToArrayOfOptionals),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/WhiteSpaceParsingTests.swift
================================================
//
// WhiteSpaceParsingTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import SWXMLHash
import XCTest
// swiftlint:disable line_length
// swiftlint:disable force_try
class WhiteSpaceParsingTests: XCTestCase {
var xml: XMLIndexer?
override func setUp() {
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"])
#else
let bundle = Bundle(for: WhiteSpaceParsingTests.self)
let path = bundle.path(forResource: "test", ofType: "xml")!
#endif
let data = try! Data(contentsOf: URL(fileURLWithPath: path))
xml = SWXMLHash.parse(data)
}
// issue #6
func testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace() {
XCTAssertEqual(xml!["niotemplate"]["section"][0]["constraint"][1].element?.text, "H:|-15-[title]-15-|")
}
func testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace() {
XCTAssertEqual(xml!["niotemplate"]["other"].element?.text, "\n \n this\n has\n white\n space\n \n ")
}
}
extension WhiteSpaceParsingTests {
static var allTests: [(String, (WhiteSpaceParsingTests) -> () throws -> Void)] {
return [
("testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace", testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace),
("testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace", testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/XMLParsingTests.swift
================================================
//
// XMLParsingTests.swift
//
// Copyright (c) 2016 David Mohundro
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import SWXMLHash
import XCTest
// swiftlint:disable force_try
// swiftlint:disable line_length
class XMLParsingTests: XCTestCase {
let xmlToParse = "header mixed contentTest Title Headermore mixed contentGambardella, MatthewXML Developer's GuideComputer44.952000-10-01An in-depth look at creating applications with XML.Ralls, KimMidnight RainFantasy5.952000-12-16A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.Corets, EvaMaeve AscendantFantasy5.952000-11-17After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society."
var xml: XMLIndexer?
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
xml = SWXMLHash.parse(xmlToParse)
}
func testShouldBeAbleToParseIndividualElements() {
XCTAssertEqual(xml!["root"]["header"]["title"].element?.text, "Test Title Header")
}
func testShouldBeAbleToParseElementGroups() {
XCTAssertEqual(xml!["root"]["catalog"]["book"][1]["author"].element?.text, "Ralls, Kim")
}
func testShouldBeAbleToParseAttributes() {
XCTAssertEqual(xml!["root"]["catalog"]["book"][1].element?.attributes["id"], "bk102")
XCTAssertEqual(xml!["root"]["catalog"]["book"][1].element?.attribute(by: "id")?.text, "bk102")
}
func testShouldBeAbleToLookUpElementsByNameAndAttribute() {
do {
let value = try xml!["root"]["catalog"]["book"].withAttr("id", "bk102")["author"].element?.text
XCTAssertEqual(value, "Ralls, Kim")
} catch {
XCTFail("\(error)")
}
}
func testShouldBeAbleToIterateElementGroups() {
let result = xml!["root"]["catalog"]["book"].all.map({ $0["genre"].element!.text! }).joined(separator: ", ")
XCTAssertEqual(result, "Computer, Fantasy, Fantasy")
}
func testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound() {
XCTAssertEqual(xml!["root"]["header"]["title"].all.count, 1)
}
func testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound() {
XCTAssertEqual(xml!["root"]["header"]["title"][0].element?.text, "Test Title Header")
}
func testShouldBeAbleToIterateUsingForIn() {
var count = 0
for _ in xml!["root"]["catalog"]["book"] {
count += 1
}
XCTAssertEqual(count, 3)
}
func testShouldBeAbleToEnumerateChildren() {
let result = xml!["root"]["catalog"]["book"][0].children.map({ $0.element!.name }).joined(separator: ", ")
XCTAssertEqual(result, "author, title, genre, price, publish_date, description")
}
func testShouldBeAbleToHandleMixedContent() {
XCTAssertEqual(xml!["root"]["header"].element?.text, "header mixed contentmore mixed content")
}
func testShouldBeAbleToIterateOverMixedContent() {
let mixedContentXml = "mixed content iteration support"
let parsed = SWXMLHash.parse(mixedContentXml)
let element = parsed["html"]["body"]["p"].element
XCTAssertNotNil(element)
if let element = element {
let result = element.children.reduce("") { acc, child in
switch child {
case let elm as SWXMLHash.XMLElement:
guard let text = elm.text else { return acc }
return acc + text
case let elm as TextElement:
return acc + elm.text
default:
XCTAssert(false, "Unknown element type")
return acc
}
}
XCTAssertEqual(result, "mixed content iteration support")
}
}
func testShouldHandleInterleavingXMLElements() {
let interleavedXml = "
one
two
three
four
"
let parsed = SWXMLHash.parse(interleavedXml)
let result = parsed["html"]["body"].children.map({ $0.element!.text! }).joined(separator: ", ")
XCTAssertEqual(result, "one, two, three, four")
}
func testShouldBeAbleToProvideADescriptionForTheDocument() {
let descriptionXml = "puppies"
let parsed = SWXMLHash.parse(descriptionXml)
XCTAssertEqual(parsed.description, "puppies")
}
// error handling
func testShouldReturnNilWhenKeysDontMatch() {
XCTAssertNil(xml!["root"]["what"]["header"]["foo"].element?.name)
}
func testShouldProvideAnErrorObjectWhenKeysDontMatch() {
var err: IndexingError?
defer {
XCTAssertNotNil(err)
}
do {
let _ = try xml!.byKey("root").byKey("what").byKey("header").byKey("foo")
} catch let error as IndexingError {
err = error
} catch { err = nil }
}
func testShouldProvideAnErrorElementWhenIndexersDontMatch() {
var err: IndexingError?
defer {
XCTAssertNotNil(err)
}
do {
let _ = try xml!.byKey("what").byKey("subelement").byIndex(5).byKey("nomatch")
} catch let error as IndexingError {
err = error
} catch { err = nil }
}
func testShouldStillReturnErrorsWhenAccessingViaSubscripting() {
var err: IndexingError? = nil
switch xml!["what"]["subelement"][5]["nomatch"] {
case .XMLError(let error):
err = error
default:
err = nil
}
XCTAssertNotNil(err)
}
}
extension XMLParsingTests {
static var allTests: [(String, (XMLParsingTests) -> () throws -> Void)] {
return [
("testShouldBeAbleToParseIndividualElements", testShouldBeAbleToParseIndividualElements),
("testShouldBeAbleToParseElementGroups", testShouldBeAbleToParseElementGroups),
("testShouldBeAbleToParseAttributes", testShouldBeAbleToParseAttributes),
("testShouldBeAbleToLookUpElementsByNameAndAttribute", testShouldBeAbleToLookUpElementsByNameAndAttribute),
("testShouldBeAbleToIterateElementGroups", testShouldBeAbleToIterateElementGroups),
("testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound", testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound),
("testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound", testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound),
("testShouldBeAbleToIterateUsingForIn", testShouldBeAbleToIterateUsingForIn),
("testShouldBeAbleToEnumerateChildren", testShouldBeAbleToEnumerateChildren),
("testShouldBeAbleToHandleMixedContent", testShouldBeAbleToHandleMixedContent),
("testShouldBeAbleToIterateOverMixedContent", testShouldBeAbleToIterateOverMixedContent),
("testShouldHandleInterleavingXMLElements", testShouldHandleInterleavingXMLElements),
("testShouldBeAbleToProvideADescriptionForTheDocument", testShouldBeAbleToProvideADescriptionForTheDocument),
("testShouldReturnNilWhenKeysDontMatch", testShouldReturnNilWhenKeysDontMatch),
("testShouldProvideAnErrorObjectWhenKeysDontMatch", testShouldProvideAnErrorObjectWhenKeysDontMatch),
("testShouldProvideAnErrorElementWhenIndexersDontMatch", testShouldProvideAnErrorElementWhenIndexersDontMatch),
("testShouldStillReturnErrorsWhenAccessingViaSubscripting", testShouldStillReturnErrorsWhenAccessingViaSubscripting),
]
}
}
================================================
FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/test.xml
================================================
Title
V:|-10-[title]-10-|
H:|-15-[title]-15-|
H:|-15-[content]-15-|
V:|-10-[content]-10-|
================================================
FILE: Dependencies/Packages/Witness-0.4.0/.gitignore
================================================
#########################
# .gitignore file for Xcode / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
#########################
#####
# OS X temporary files that should never be committed
.DS_Store
*.swp
*.lock
profile
####
# Xcode temporary files that should never be committed
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...
*~.nib
####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"
DerivedData/
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"
build/
#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
# saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
# ..but if you're in the 1%, comment out the line "*.pbxuser"
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
# NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
####
# Xcode 4 - semi-personal settings
#
#
# OPTION 1: ---------------------------------
# throw away ALL personal settings (including custom schemes!
# - unless they are "shared")
#
# NB: this is exclusive with OPTION 2 below
xcuserdata
# OPTION 2: ---------------------------------
# get rid of ALL personal settings, but KEEP SOME OF THEM
# - NB: you must manually uncomment the bits you want to keep
#
# NB: this is exclusive with OPTION 1 above
#
#xcuserdata/**/*
# (requires option 2 above): Personal Schemes
#
#!xcuserdata/**/xcschemes/*
####
# XCode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# /(root)/
# /(project-name).xcodeproj/
# project.pbxproj
# /project.xcworkspace/
# contents.xcworkspacedata
# /xcuserdata/
# /(your name)/xcuserdatad/
# UserInterfaceState.xcuserstate
# /xcsshareddata/
# /xcschemes/
# (shared scheme name).xcscheme
# /xcuserdata/
# /(your name)/xcuserdatad/
# (private scheme).xcscheme
# xcschememanagement.plist
#
#
####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!
*.moved-aside
####
# Cocoapods: cocoapods.org
#
# Ignoring these files means that whoever uses the code will first have to run:
# pod install
# in the App.xcodeproj directory.
# This ensures the latest dependencies are used.
# SK: We don't want to include the Pod source in our repo, but the lock file is
# needed for Pod sha management among the team.
Pods/
!Podfile.lock
####
# Xcode 5 - Source Control files
#
# Xcode 5 introduced a new file type .xccheckout. This files contains VCS metadata
# and should therefore not be checked into the VCS.
*.xccheckout
================================================
FILE: Dependencies/Packages/Witness-0.4.0/CHANGELOG.md
================================================
# Witness Changelog
## Master
## 0.2.0
### Enhancements
- Adds support for SPM
================================================
FILE: Dependencies/Packages/Witness-0.4.0/LICENSE
================================================
Copyright (c) 2015 Niels de Hoog
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: Dependencies/Packages/Witness-0.4.0/Package.swift
================================================
import PackageDescription
let package = Package(
name: "Witness"
)
================================================
FILE: Dependencies/Packages/Witness-0.4.0/README.md
================================================
# Witness
Monitor file system changes using Swift. Witness provides a wrapper around the [File System Events](https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/FSEvents_ProgGuide/Introduction/Introduction.html) API for OS X.
## Installation
The recommended way to include Witness in your project is by using [Carthage](https://github.com/Carthage/Carthage). Simply add this line to your `Cartfile`:
github "njdehoog/Witness" ~> 0.1
Also you can install via [Swift Package Manager](https://swift.org/package-manager/).
## Usage
Import the framework
```swift
import Witness
```
### Monitor file system events
This will trigger an event when a file in the Desktop directory is created, deleted or modified.
```swift
if let desktopPath = NSSearchPathForDirectoriesInDomains(.DesktopDirectory, .UserDomainMask, true).first {
self.witness = Witness(paths: [desktopPath], flags: .FileEvents, latency: 0.3) { events in
print("file system events received: \(events)")
}
}
```
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
## Credits
Witness was developed for use in [Spelt](http://spelt.io). If you like this library, please consider supporting development by purchasing the app.
## License
Witness is released under the MIT license. See LICENSE for details.
================================================
FILE: Dependencies/Packages/Witness-0.4.0/Sources/EventStream.swift
================================================
//
// EventStream.swift
// Witness
//
// Created by Niels de Hoog on 23/09/15.
// Copyright © 2015 Invisible Pixel. All rights reserved.
//
import Foundation
/**
* The type of event stream to be used. For more information, please refer to the File System Events Programming Guide: https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/FSEvents_ProgGuide/UsingtheFSEventsFramework/UsingtheFSEventsFramework.html#//apple_ref/doc/uid/TP40005289-CH4-SW6
*/
public enum StreamType {
case hostBased // default
case diskBased
}
class EventStream {
let paths: [String]
// use explicitly unwrapped optional so we can pass self as context to stream
private var stream: FSEventStreamRef!
private let changeHandler: FileEventHandler
init(paths: [String], type: StreamType = .hostBased, flags: EventStreamCreateFlags, latency: TimeInterval, deviceToWatch: dev_t = 0, changeHandler: @escaping FileEventHandler) {
self.paths = paths
self.changeHandler = changeHandler
func callBack (_ stream: OpaquePointer, clientCallbackInfo: UnsafeMutableRawPointer?, numEvents: Int, eventPaths: UnsafeMutableRawPointer, eventFlags: UnsafePointer?, eventIDs: UnsafePointer?) -> Void {
guard let eventFlags = eventFlags else {
return
}
let eventStream = unsafeBitCast(clientCallbackInfo, to: EventStream.self)
let paths = unsafeBitCast(eventPaths, to: NSArray.self)
var events = [FileEvent]()
for i in 0.. ()
public struct Witness {
private let stream: EventStream
var paths: [String] {
return stream.paths
}
public init(paths: [String], flags: EventStreamCreateFlags = .None, latency: TimeInterval = 1.0, changeHandler: @escaping FileEventHandler) {
self.stream = EventStream(paths: paths, flags: flags, latency: latency, changeHandler: changeHandler)
}
public init(paths: [String], streamType: StreamType, flags: EventStreamCreateFlags = .None, latency: TimeInterval = 1.0, deviceToWatch: dev_t, changeHandler: @escaping FileEventHandler) {
self.stream = EventStream(paths: paths, type: streamType, flags: flags, latency: latency, deviceToWatch: deviceToWatch, changeHandler: changeHandler)
}
public func flush() {
self.stream.flush()
}
public func flushAsync() {
self.stream.flushAsync()
}
}
================================================
FILE: Dependencies/Packages/Witness-0.4.0/Tests/LinuxMain.swift
================================================
import XCTest
@testable import WitnessPackageTests
XCTMain([
testCase(WitnessPackageTests.allTests),
])
================================================
FILE: Dependencies/Packages/Witness-0.4.0/Tests/WitnessPackageTests/WitnessPackageTests.swift
================================================
import XCTest
@testable import WitnessPackage
class WitnessPackageTests: XCTestCase {
static let expectationTimeout = 2.0
static let latency: TimeInterval = 0.1
let fileManager = FileManager()
var witness: Witness?
var temporaryDirectory: String {
return NSTemporaryDirectory()
}
var testsDirectory: String {
return (temporaryDirectory as NSString).appendingPathComponent("WitnessPackageTests")
}
var filePath: String {
return (testsDirectory as NSString).appendingPathComponent("file.txt")
}
override func setUp() {
super.setUp()
// create tests directory
print("create tests directory at path: \(testsDirectory)")
try! fileManager.createDirectory(atPath: testsDirectory, withIntermediateDirectories: true, attributes: nil)
}
override func tearDown() {
witness?.flush()
witness = nil
do {
// remove tests directory
try fileManager.removeItem(atPath: testsDirectory)
}
catch {}
super.tearDown()
}
func waitForPendingEvents() {
print("wait for pending changes...")
var didArrive = false
witness = Witness(paths: [testsDirectory], flags: [.NoDefer, .WatchRoot], latency: WitnessPackageTests.latency) { events in
print("pending changes arrived")
didArrive = true
}
while !didArrive {
CFRunLoopRunInMode(CFRunLoopMode.defaultMode, 0.02, true);
}
}
func delay(_ interval: TimeInterval, block: @escaping () -> ()) {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(interval * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: block)
}
func testThatFileCreationIsObserved() {
var expectation: XCTestExpectation? = self.expectation(description: "File creation should trigger event")
witness = Witness(paths: [testsDirectory], flags: .FileEvents) { events in
for event in events {
if event.flags.contains(.ItemCreated) {
expectation?.fulfill()
expectation = nil
}
}
}
fileManager.createFile(atPath: filePath, contents: nil, attributes: nil)
waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil)
}
func testThatFileRemovalIsObserved() {
let expectation = self.expectation(description: "File removal should trigger event")
fileManager.createFile(atPath: filePath, contents: nil, attributes: nil)
waitForPendingEvents()
witness = Witness(paths: [testsDirectory]) { events in
expectation.fulfill()
}
try! fileManager.removeItem(atPath: filePath)
waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil)
}
func testThatFileChangesAreObserved() {
let expectation = self.expectation(description: "File changes should trigger event")
fileManager.createFile(atPath: filePath, contents: nil, attributes: nil)
waitForPendingEvents()
witness = Witness(paths: [testsDirectory]) { events in
expectation.fulfill()
}
try! "Hello changes".write(toFile: filePath, atomically: true, encoding: String.Encoding.utf8)
waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil)
}
func testThatRootDirectoryIsNotObserved() {
let expectation = self.expectation(description: "Removing root directory should not trigger event if .WatchRoot flag is not set")
var didReceiveEvent = false
witness = Witness(paths: [testsDirectory], flags: .NoDefer) { events in
didReceiveEvent = true
}
delay(WitnessPackageTests.latency * 2) {
if didReceiveEvent == false {
expectation.fulfill()
}
}
try! fileManager.removeItem(atPath: testsDirectory)
waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil)
}
func testThatRootDirectoryIsObserved() {
let expectation = self.expectation(description: "Removing root directory should trigger event if .WatchRoot flag is set")
witness = Witness(paths: [testsDirectory], flags: .WatchRoot) { events in
expectation.fulfill()
}
try! fileManager.removeItem(atPath: testsDirectory)
waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil)
}
}
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Commandant_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/PathKit_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Result_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/SWXMLHash_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/SourceKittenFramework_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Spectre_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Stencil_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Witness_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Yaml_Info.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
================================================
FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
OBJ_123 /* Case.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_9 /* Case.swift */; };
OBJ_124 /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_10 /* Context.swift */; };
OBJ_125 /* Expectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_11 /* Expectation.swift */; };
OBJ_126 /* Failure.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_12 /* Failure.swift */; };
OBJ_127 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_13 /* Global.swift */; };
OBJ_128 /* GlobalContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_14 /* GlobalContext.swift */; };
OBJ_129 /* Reporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_15 /* Reporter.swift */; };
OBJ_130 /* Reporters.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_16 /* Reporters.swift */; };
OBJ_137 /* PathKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_18 /* PathKit.swift */; };
OBJ_139 /* Spectre.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_108 /* Spectre.framework */; };
OBJ_146 /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_20 /* Context.swift */; };
OBJ_147 /* Filters.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_21 /* Filters.swift */; };
OBJ_148 /* ForTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_22 /* ForTag.swift */; };
OBJ_149 /* IfTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_23 /* IfTag.swift */; };
OBJ_150 /* Include.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_24 /* Include.swift */; };
OBJ_151 /* Inheritence.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_25 /* Inheritence.swift */; };
OBJ_152 /* Lexer.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_26 /* Lexer.swift */; };
OBJ_153 /* Namespace.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_27 /* Namespace.swift */; };
OBJ_154 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_28 /* Node.swift */; };
OBJ_155 /* NowTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_29 /* NowTag.swift */; };
OBJ_156 /* Parser.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_30 /* Parser.swift */; };
OBJ_157 /* Template.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_31 /* Template.swift */; };
OBJ_158 /* TemplateLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_32 /* TemplateLoader.swift */; };
OBJ_159 /* Tokenizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_33 /* Tokenizer.swift */; };
OBJ_160 /* Variable.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_34 /* Variable.swift */; };
OBJ_162 /* Spectre.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_108 /* Spectre.framework */; };
OBJ_163 /* PathKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_109 /* PathKit.framework */; };
OBJ_171 /* EventStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_36 /* EventStream.swift */; };
OBJ_172 /* FileEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_37 /* FileEvent.swift */; };
OBJ_173 /* Witness.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_38 /* Witness.swift */; };
OBJ_180 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_40 /* Result.swift */; };
OBJ_181 /* ResultProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_41 /* ResultProtocol.swift */; };
OBJ_188 /* Argument.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_43 /* Argument.swift */; };
OBJ_189 /* ArgumentParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_44 /* ArgumentParser.swift */; };
OBJ_190 /* ArgumentProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_45 /* ArgumentProtocol.swift */; };
OBJ_191 /* Command.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_46 /* Command.swift */; };
OBJ_192 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_47 /* Errors.swift */; };
OBJ_193 /* HelpCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_48 /* HelpCommand.swift */; };
OBJ_194 /* LinuxSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_49 /* LinuxSupport.swift */; };
OBJ_195 /* Option.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_50 /* Option.swift */; };
OBJ_196 /* Switch.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_51 /* Switch.swift */; };
OBJ_198 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_112 /* Result.framework */; };
OBJ_205 /* SWXMLHash+TypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_53 /* SWXMLHash+TypeConversion.swift */; };
OBJ_206 /* SWXMLHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_54 /* SWXMLHash.swift */; };
OBJ_213 /* Yaml.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_56 /* Yaml.swift */; };
OBJ_214 /* YAMLOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_57 /* YAMLOperators.swift */; };
OBJ_215 /* YAMLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_58 /* YAMLParser.swift */; };
OBJ_216 /* YAMLRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_59 /* YAMLRegex.swift */; };
OBJ_217 /* YAMLResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_60 /* YAMLResult.swift */; };
OBJ_218 /* YAMLTokenizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_61 /* YAMLTokenizer.swift */; };
OBJ_225 /* CompleteCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_63 /* CompleteCommand.swift */; };
OBJ_226 /* DocCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_64 /* DocCommand.swift */; };
OBJ_227 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_65 /* Errors.swift */; };
OBJ_228 /* FormatCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_66 /* FormatCommand.swift */; };
OBJ_229 /* IndexCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_67 /* IndexCommand.swift */; };
OBJ_230 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_68 /* main.swift */; };
OBJ_231 /* StructureCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_69 /* StructureCommand.swift */; };
OBJ_232 /* SyntaxCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_70 /* SyntaxCommand.swift */; };
OBJ_233 /* VersionCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_71 /* VersionCommand.swift */; };
OBJ_235 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_112 /* Result.framework */; };
OBJ_236 /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_113 /* Commandant.framework */; };
OBJ_237 /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_114 /* SWXMLHash.framework */; };
OBJ_238 /* Yaml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_115 /* Yaml.framework */; };
OBJ_239 /* SourceKittenFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_117 /* SourceKittenFramework.framework */; };
OBJ_250 /* Clang+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_73 /* Clang+SourceKitten.swift */; };
OBJ_251 /* ClangTranslationUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_74 /* ClangTranslationUnit.swift */; };
OBJ_252 /* CodeCompletionItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_75 /* CodeCompletionItem.swift */; };
OBJ_253 /* Dictionary+Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_76 /* Dictionary+Merge.swift */; };
OBJ_254 /* Documentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_77 /* Documentation.swift */; };
OBJ_255 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_78 /* File.swift */; };
OBJ_256 /* JSONOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_79 /* JSONOutput.swift */; };
OBJ_257 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_80 /* Language.swift */; };
OBJ_258 /* library_wrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_81 /* library_wrapper.swift */; };
OBJ_259 /* library_wrapper_CXString.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_82 /* library_wrapper_CXString.swift */; };
OBJ_260 /* library_wrapper_Documentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_83 /* library_wrapper_Documentation.swift */; };
OBJ_261 /* library_wrapper_Index.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_84 /* library_wrapper_Index.swift */; };
OBJ_262 /* library_wrapper_sourcekitd.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_85 /* library_wrapper_sourcekitd.swift */; };
OBJ_263 /* LinuxCompatibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_86 /* LinuxCompatibility.swift */; };
OBJ_264 /* Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_87 /* Module.swift */; };
OBJ_265 /* ObjCDeclarationKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_88 /* ObjCDeclarationKind.swift */; };
OBJ_266 /* OffsetMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_89 /* OffsetMap.swift */; };
OBJ_267 /* Parameter.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_90 /* Parameter.swift */; };
OBJ_268 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_91 /* Request.swift */; };
OBJ_269 /* SourceDeclaration.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_92 /* SourceDeclaration.swift */; };
OBJ_270 /* SourceLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_93 /* SourceLocation.swift */; };
OBJ_271 /* StatementKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_94 /* StatementKind.swift */; };
OBJ_272 /* String+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_95 /* String+SourceKitten.swift */; };
OBJ_273 /* Structure.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_96 /* Structure.swift */; };
OBJ_274 /* SwiftDeclarationKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_97 /* SwiftDeclarationKind.swift */; };
OBJ_275 /* SwiftDocKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_98 /* SwiftDocKey.swift */; };
OBJ_276 /* SwiftDocs.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_99 /* SwiftDocs.swift */; };
OBJ_277 /* SwiftLangSyntax.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_100 /* SwiftLangSyntax.swift */; };
OBJ_278 /* SyntaxKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_101 /* SyntaxKind.swift */; };
OBJ_279 /* SyntaxMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_102 /* SyntaxMap.swift */; };
OBJ_280 /* SyntaxToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_103 /* SyntaxToken.swift */; };
OBJ_281 /* Text.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_104 /* Text.swift */; };
OBJ_282 /* Xcode.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_105 /* Xcode.swift */; };
OBJ_284 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_112 /* Result.framework */; };
OBJ_285 /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_113 /* Commandant.framework */; };
OBJ_286 /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_114 /* SWXMLHash.framework */; };
OBJ_287 /* Yaml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_115 /* Yaml.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
FA1B61C21DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_118;
remoteInfo = Spectre;
};
FA1B61C31DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_118;
remoteInfo = Spectre;
};
FA1B61C41DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_132;
remoteInfo = PathKit;
};
FA1B61C51DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_175;
remoteInfo = Result;
};
FA1B61C61DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_175;
remoteInfo = Result;
};
FA1B61C71DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_183;
remoteInfo = Commandant;
};
FA1B61C81DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_200;
remoteInfo = SWXMLHash;
};
FA1B61C91DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_208;
remoteInfo = Yaml;
};
FA1B61CA1DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_245;
remoteInfo = SourceKittenFramework;
};
FA1B61CB1DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_175;
remoteInfo = Result;
};
FA1B61CC1DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_183;
remoteInfo = Commandant;
};
FA1B61CD1DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_200;
remoteInfo = SWXMLHash;
};
FA1B61CE1DEB65A8004599FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = OBJ_208;
remoteInfo = Yaml;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
OBJ_10 /* Context.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Context.swift; sourceTree = ""; };
OBJ_100 /* SwiftLangSyntax.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftLangSyntax.swift; sourceTree = ""; };
OBJ_101 /* SyntaxKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyntaxKind.swift; sourceTree = ""; };
OBJ_102 /* SyntaxMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyntaxMap.swift; sourceTree = ""; };
OBJ_103 /* SyntaxToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyntaxToken.swift; sourceTree = ""; };
OBJ_104 /* Text.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Text.swift; sourceTree = ""; };
OBJ_105 /* Xcode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Xcode.swift; sourceTree = ""; };
OBJ_108 /* Spectre.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Spectre.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_109 /* PathKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PathKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_11 /* Expectation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Expectation.swift; sourceTree = ""; };
OBJ_110 /* Stencil.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Stencil.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_111 /* Witness.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Witness.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_112 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_113 /* Commandant.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Commandant.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_114 /* SWXMLHash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SWXMLHash.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_115 /* Yaml.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Yaml.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_116 /* sourcekitten */ = {isa = PBXFileReference; lastKnownFileType = text; path = sourcekitten; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_117 /* SourceKittenFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SourceKittenFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_12 /* Failure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Failure.swift; sourceTree = ""; };
OBJ_13 /* Global.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Global.swift; sourceTree = ""; };
OBJ_14 /* GlobalContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalContext.swift; sourceTree = ""; };
OBJ_15 /* Reporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reporter.swift; sourceTree = ""; };
OBJ_16 /* Reporters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reporters.swift; sourceTree = ""; };
OBJ_18 /* PathKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PathKit.swift; sourceTree = ""; };
OBJ_20 /* Context.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Context.swift; sourceTree = ""; };
OBJ_21 /* Filters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Filters.swift; sourceTree = ""; };
OBJ_22 /* ForTag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForTag.swift; sourceTree = ""; };
OBJ_23 /* IfTag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IfTag.swift; sourceTree = ""; };
OBJ_24 /* Include.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Include.swift; sourceTree = ""; };
OBJ_25 /* Inheritence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Inheritence.swift; sourceTree = ""; };
OBJ_26 /* Lexer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Lexer.swift; sourceTree = ""; };
OBJ_27 /* Namespace.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Namespace.swift; sourceTree = ""; };
OBJ_28 /* Node.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Node.swift; sourceTree = ""; };
OBJ_29 /* NowTag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowTag.swift; sourceTree = ""; };
OBJ_30 /* Parser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = ""; };
OBJ_31 /* Template.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Template.swift; sourceTree = ""; };
OBJ_32 /* TemplateLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemplateLoader.swift; sourceTree = ""; };
OBJ_33 /* Tokenizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tokenizer.swift; sourceTree = ""; };
OBJ_34 /* Variable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Variable.swift; sourceTree = ""; };
OBJ_36 /* EventStream.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventStream.swift; sourceTree = ""; };
OBJ_37 /* FileEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileEvent.swift; sourceTree = ""; };
OBJ_38 /* Witness.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Witness.swift; sourceTree = ""; };
OBJ_40 /* Result.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; };
OBJ_41 /* ResultProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultProtocol.swift; sourceTree = ""; };
OBJ_43 /* Argument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Argument.swift; sourceTree = ""; };
OBJ_44 /* ArgumentParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArgumentParser.swift; sourceTree = ""; };
OBJ_45 /* ArgumentProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArgumentProtocol.swift; sourceTree = ""; };
OBJ_46 /* Command.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Command.swift; sourceTree = ""; };
OBJ_47 /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; };
OBJ_48 /* HelpCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpCommand.swift; sourceTree = ""; };
OBJ_49 /* LinuxSupport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxSupport.swift; sourceTree = ""; };
OBJ_50 /* Option.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Option.swift; sourceTree = ""; };
OBJ_51 /* Switch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Switch.swift; sourceTree = ""; };
OBJ_53 /* SWXMLHash+TypeConversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SWXMLHash+TypeConversion.swift"; sourceTree = ""; };
OBJ_54 /* SWXMLHash.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SWXMLHash.swift; sourceTree = ""; };
OBJ_56 /* Yaml.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Yaml.swift; sourceTree = ""; };
OBJ_57 /* YAMLOperators.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLOperators.swift; sourceTree = ""; };
OBJ_58 /* YAMLParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLParser.swift; sourceTree = ""; };
OBJ_59 /* YAMLRegex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLRegex.swift; sourceTree = ""; };
OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; };
OBJ_60 /* YAMLResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLResult.swift; sourceTree = ""; };
OBJ_61 /* YAMLTokenizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLTokenizer.swift; sourceTree = ""; };
OBJ_63 /* CompleteCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompleteCommand.swift; sourceTree = ""; };
OBJ_64 /* DocCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocCommand.swift; sourceTree = ""; };
OBJ_65 /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; };
OBJ_66 /* FormatCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatCommand.swift; sourceTree = ""; };
OBJ_67 /* IndexCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndexCommand.swift; sourceTree = ""; };
OBJ_68 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; };
OBJ_69 /* StructureCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StructureCommand.swift; sourceTree = ""; };
OBJ_70 /* SyntaxCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyntaxCommand.swift; sourceTree = ""; };
OBJ_71 /* VersionCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionCommand.swift; sourceTree = ""; };
OBJ_73 /* Clang+SourceKitten.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Clang+SourceKitten.swift"; sourceTree = ""; };
OBJ_74 /* ClangTranslationUnit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClangTranslationUnit.swift; sourceTree = ""; };
OBJ_75 /* CodeCompletionItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeCompletionItem.swift; sourceTree = ""; };
OBJ_76 /* Dictionary+Merge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+Merge.swift"; sourceTree = ""; };
OBJ_77 /* Documentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Documentation.swift; sourceTree = ""; };
OBJ_78 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; };
OBJ_79 /* JSONOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONOutput.swift; sourceTree = ""; };
OBJ_80 /* Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = ""; };
OBJ_81 /* library_wrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper.swift; sourceTree = ""; };
OBJ_82 /* library_wrapper_CXString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper_CXString.swift; sourceTree = ""; };
OBJ_83 /* library_wrapper_Documentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper_Documentation.swift; sourceTree = ""; };
OBJ_84 /* library_wrapper_Index.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper_Index.swift; sourceTree = ""; };
OBJ_85 /* library_wrapper_sourcekitd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper_sourcekitd.swift; sourceTree = ""; };
OBJ_86 /* LinuxCompatibility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxCompatibility.swift; sourceTree = ""; };
OBJ_87 /* Module.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Module.swift; sourceTree = ""; };
OBJ_88 /* ObjCDeclarationKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjCDeclarationKind.swift; sourceTree = ""; };
OBJ_89 /* OffsetMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OffsetMap.swift; sourceTree = ""; };
OBJ_9 /* Case.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Case.swift; sourceTree = ""; };
OBJ_90 /* Parameter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Parameter.swift; sourceTree = ""; };
OBJ_91 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; };
OBJ_92 /* SourceDeclaration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceDeclaration.swift; sourceTree = ""; };
OBJ_93 /* SourceLocation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceLocation.swift; sourceTree = ""; };
OBJ_94 /* StatementKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatementKind.swift; sourceTree = ""; };
OBJ_95 /* String+SourceKitten.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+SourceKitten.swift"; sourceTree = ""; };
OBJ_96 /* Structure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Structure.swift; sourceTree = ""; };
OBJ_97 /* SwiftDeclarationKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDeclarationKind.swift; sourceTree = ""; };
OBJ_98 /* SwiftDocKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDocKey.swift; sourceTree = ""; };
OBJ_99 /* SwiftDocs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDocs.swift; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
OBJ_131 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_138 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
OBJ_139 /* Spectre.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_161 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
OBJ_162 /* Spectre.framework in Frameworks */,
OBJ_163 /* PathKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_174 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_182 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_197 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
OBJ_198 /* Result.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_207 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_219 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_234 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
OBJ_235 /* Result.framework in Frameworks */,
OBJ_236 /* Commandant.framework in Frameworks */,
OBJ_237 /* SWXMLHash.framework in Frameworks */,
OBJ_238 /* Yaml.framework in Frameworks */,
OBJ_239 /* SourceKittenFramework.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
OBJ_283 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 0;
files = (
OBJ_284 /* Result.framework in Frameworks */,
OBJ_285 /* Commandant.framework in Frameworks */,
OBJ_286 /* SWXMLHash.framework in Frameworks */,
OBJ_287 /* Yaml.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
OBJ_106 /* Tests */ = {
isa = PBXGroup;
children = (
);
path = Tests;
sourceTree = "";
};
OBJ_107 /* Products */ = {
isa = PBXGroup;
children = (
OBJ_108 /* Spectre.framework */,
OBJ_109 /* PathKit.framework */,
OBJ_110 /* Stencil.framework */,
OBJ_111 /* Witness.framework */,
OBJ_112 /* Result.framework */,
OBJ_113 /* Commandant.framework */,
OBJ_114 /* SWXMLHash.framework */,
OBJ_115 /* Yaml.framework */,
OBJ_116 /* sourcekitten */,
OBJ_117 /* SourceKittenFramework.framework */,
);
name = Products;
sourceTree = BUILT_PRODUCTS_DIR;
};
OBJ_17 /* PathKit */ = {
isa = PBXGroup;
children = (
OBJ_18 /* PathKit.swift */,
);
name = PathKit;
path = "Packages/PathKit-0.7.1/Sources";
sourceTree = SOURCE_ROOT;
};
OBJ_19 /* Stencil */ = {
isa = PBXGroup;
children = (
OBJ_20 /* Context.swift */,
OBJ_21 /* Filters.swift */,
OBJ_22 /* ForTag.swift */,
OBJ_23 /* IfTag.swift */,
OBJ_24 /* Include.swift */,
OBJ_25 /* Inheritence.swift */,
OBJ_26 /* Lexer.swift */,
OBJ_27 /* Namespace.swift */,
OBJ_28 /* Node.swift */,
OBJ_29 /* NowTag.swift */,
OBJ_30 /* Parser.swift */,
OBJ_31 /* Template.swift */,
OBJ_32 /* TemplateLoader.swift */,
OBJ_33 /* Tokenizer.swift */,
OBJ_34 /* Variable.swift */,
);
name = Stencil;
path = "Packages/Stencil-0.6.0/Sources";
sourceTree = SOURCE_ROOT;
};
OBJ_35 /* Witness */ = {
isa = PBXGroup;
children = (
OBJ_36 /* EventStream.swift */,
OBJ_37 /* FileEvent.swift */,
OBJ_38 /* Witness.swift */,
);
name = Witness;
path = "Packages/Witness-0.4.0/Sources";
sourceTree = SOURCE_ROOT;
};
OBJ_39 /* Result */ = {
isa = PBXGroup;
children = (
OBJ_40 /* Result.swift */,
OBJ_41 /* ResultProtocol.swift */,
);
name = Result;
path = "Packages/Result-3.0.0/Result";
sourceTree = SOURCE_ROOT;
};
OBJ_42 /* Commandant */ = {
isa = PBXGroup;
children = (
OBJ_43 /* Argument.swift */,
OBJ_44 /* ArgumentParser.swift */,
OBJ_45 /* ArgumentProtocol.swift */,
OBJ_46 /* Command.swift */,
OBJ_47 /* Errors.swift */,
OBJ_48 /* HelpCommand.swift */,
OBJ_49 /* LinuxSupport.swift */,
OBJ_50 /* Option.swift */,
OBJ_51 /* Switch.swift */,
);
name = Commandant;
path = "Packages/Commandant-0.11.2/Sources/Commandant";
sourceTree = SOURCE_ROOT;
};
OBJ_5 /* */ = {
isa = PBXGroup;
children = (
OBJ_6 /* Package.swift */,
OBJ_7 /* Sources */,
OBJ_106 /* Tests */,
OBJ_107 /* Products */,
);
name = "";
sourceTree = "";
};
OBJ_52 /* SWXMLHash */ = {
isa = PBXGroup;
children = (
OBJ_53 /* SWXMLHash+TypeConversion.swift */,
OBJ_54 /* SWXMLHash.swift */,
);
name = SWXMLHash;
path = "Packages/SWXMLHash-3.0.2/Source";
sourceTree = SOURCE_ROOT;
};
OBJ_55 /* Yaml */ = {
isa = PBXGroup;
children = (
OBJ_56 /* Yaml.swift */,
OBJ_57 /* YAMLOperators.swift */,
OBJ_58 /* YAMLParser.swift */,
OBJ_59 /* YAMLRegex.swift */,
OBJ_60 /* YAMLResult.swift */,
OBJ_61 /* YAMLTokenizer.swift */,
);
name = Yaml;
path = "Packages/Yaml-3.1.0/Yaml";
sourceTree = SOURCE_ROOT;
};
OBJ_62 /* sourcekitten */ = {
isa = PBXGroup;
children = (
OBJ_63 /* CompleteCommand.swift */,
OBJ_64 /* DocCommand.swift */,
OBJ_65 /* Errors.swift */,
OBJ_66 /* FormatCommand.swift */,
OBJ_67 /* IndexCommand.swift */,
OBJ_68 /* main.swift */,
OBJ_69 /* StructureCommand.swift */,
OBJ_70 /* SyntaxCommand.swift */,
OBJ_71 /* VersionCommand.swift */,
);
name = sourcekitten;
path = "Packages/SourceKitten-0.15.0/Source/sourcekitten";
sourceTree = SOURCE_ROOT;
};
OBJ_7 /* Sources */ = {
isa = PBXGroup;
children = (
OBJ_8 /* Spectre */,
OBJ_17 /* PathKit */,
OBJ_19 /* Stencil */,
OBJ_35 /* Witness */,
OBJ_39 /* Result */,
OBJ_42 /* Commandant */,
OBJ_52 /* SWXMLHash */,
OBJ_55 /* Yaml */,
OBJ_62 /* sourcekitten */,
OBJ_72 /* SourceKittenFramework */,
);
path = Sources;
sourceTree = "