diff --git a/.github/workflows/amazon-linux-2.yml b/.github/workflows/amazon-linux-2.yml index d5b9518..e3349e7 100644 --- a/.github/workflows/amazon-linux-2.yml +++ b/.github/workflows/amazon-linux-2.yml @@ -1,19 +1,12 @@ name: Amazon Linux 2 -on: [push, pull_request] +on: [push] jobs: linux: name: Amazon Linux 2 runs-on: ubuntu-latest - strategy: - matrix: - swift: - - 5.3 - - 5.3.1 - distro: - - amazonlinux2 steps: - uses: actions/checkout@v2 - name: Test - run: Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' ${{ matrix.swift }} ${{ matrix.distro }} + run: Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' 5.5.3 amazonlinux2 diff --git a/.github/workflows/centos-8.yml b/.github/workflows/centos-8.yml deleted file mode 100644 index a99de58..0000000 --- a/.github/workflows/centos-8.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: CentOS 8 - -on: [push, pull_request] - -jobs: - linux: - name: CentOS 8 - runs-on: ubuntu-latest - strategy: - matrix: - swift: - - 5.3 - - 5.3.1 - distro: - - centos8 - steps: - - uses: actions/checkout@v2 - - name: Test - run: Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' ${{ matrix.swift }} ${{ matrix.distro }} diff --git a/.github/workflows/macos-11.15.yml b/.github/workflows/macos-11.15.yml deleted file mode 100644 index e09170b..0000000 --- a/.github/workflows/macos-11.15.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: macOS 11.15 - -on: [push, pull_request] - -jobs: - macos: - name: macOS - runs-on: macos-latest - strategy: - matrix: - xcode: - - 11.7 - - 13.2 - action: - - SwiftPM - steps: - - uses: actions/checkout@v2 - - name: Xcode version - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - - name: Test - run: make test-${{ matrix.action }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..49fc714 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,14 @@ +name: macOS + +on: [push] + +jobs: + macos: + name: macOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Xcode version + run: sudo xcode-select -s /Applications/Xcode_13.2.app + - name: Test + run: make test-SwiftPM diff --git a/.github/workflows/ubuntu-bionic.yml b/.github/workflows/ubuntu-bionic.yml index 424a746..0a1e1cf 100644 --- a/.github/workflows/ubuntu-bionic.yml +++ b/.github/workflows/ubuntu-bionic.yml @@ -1,19 +1,12 @@ name: Ubuntu Bionic -on: [push, pull_request] +on: [push] jobs: linux: name: Ubuntu Bionic runs-on: ubuntu-latest - strategy: - matrix: - swift: - - 5.3 - - 5.3.1 - distro: - - bionic steps: - uses: actions/checkout@v2 - name: Test - run: Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' ${{ matrix.swift }} ${{ matrix.distro }} + run: Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' 5.5.3 bionic diff --git a/.github/workflows/ubuntu-focal.yml b/.github/workflows/ubuntu-focal.yml index 0cb160e..fee8b41 100644 --- a/.github/workflows/ubuntu-focal.yml +++ b/.github/workflows/ubuntu-focal.yml @@ -1,19 +1,12 @@ name: Ubuntu Focal -on: [push, pull_request] +on: [push] jobs: linux: name: Ubuntu Focal runs-on: ubuntu-latest - strategy: - matrix: - swift: - - 5.3 - - 5.3.1 - distro: - - focal steps: - uses: actions/checkout@v2 - name: Test - run: Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' ${{ matrix.swift }} ${{ matrix.distro }} + run: Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' 5.5.3 focal diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..3cd46d7 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,21 @@ +name: Windows 2019 + +on: [push] + +jobs: + Windows: + name: Windows + runs-on: windows-2019 + steps: + - name: Check out + uses: actions/checkout@v2 + - name: Install Swift + uses: compnerd/gha-setup-swift@cf2a61060c146203ea6fe10cce367979ae4ec0b1 + with: + branch: swift-5.5.3-release + tag: 5.5.3-RELEASE + - name: Test + shell: cmd + run: | + echo on + swift test -Xswiftc -warnings-as-errors diff --git a/Makefile b/Makefile index 4688547..59c7148 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,10 @@ build: @swift build -c release -Xswiftc -warnings-as-errors > /dev/null test-SwiftPM: - @swift test -Xswiftc -warnings-as-errors --enable-test-discovery + @swift test -Xswiftc -warnings-as-errors test-docker: - @Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' 5.3.1 focal + @Scripts/docker.sh TOMLDecoder 'swift test -Xswiftc -warnings-as-errors --enable-test-discovery' 5.5.3 focal benchmark: @cd Benchmarks; swift run -c release diff --git a/README.md b/README.md index 996be15..529b790 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # TOMLDecoder -| Swift 5.3 & 5.3.1 | |-| |[![Amazon Linux 2](https://github.com/dduan/TOMLDecoder/workflows/Amazon%20Linux%202/badge.svg)](https://github.com/dduan/TOMLDecoder/actions?query=workflow%3A%22Amazon+Linux+2%22)| -|[![CentOS 8](https://github.com/dduan/TOMLDecoder/workflows/CentOS%208/badge.svg)](https://github.com/dduan/TOMLDecoder/actions?query=workflow%3A%22CentOS+8%22)| -|[![macOS 11.15](https://github.com/dduan/TOMLDecoder/workflows/macOS%2011.15/badge.svg)](https://github.com/dduan/TOMLDecoder/actions?query=workflow%3A%22macOS+11.15%22)| +|[![CentOS 7](https://github.com/dduan/TOMLDecoder/workflows/CentOS%207/badge.svg)](https://github.com/dduan/TOMLDecoder/actions?query=workflow%3A%22CentOS+7%22)| +|[![macOS](https://github.com/dduan/TOMLDecoder/workflows/macOS/badge.svg)](https://github.com/dduan/TOMLDecoder/actions?query=workflow%3A%22macOS%22)| |[![Ubuntu Bionic](https://github.com/dduan/TOMLDecoder/workflows/Ubuntu%20Bionic/badge.svg)](https://github.com/dduan/TOMLDecoder/actions?query=workflow%3A%22Ubuntu+Bionic%22)| |[![Ubuntu Focal](https://github.com/dduan/TOMLDecoder/workflows/Ubuntu%20Focal/badge.svg)](https://github.com/dduan/TOMLDecoder/actions?query=workflow%3A%22Ubuntu+Focal%22)| +|[![Windows](https://github.com/dduan/TOMLDecoder/workflows/Windows/badge.svg)](https://github.com/dduan/TOMLDecoder/actions?query=workflow%3A%22Windows%22)| TOML parser for your Swift `Codable`s. diff --git a/Tests/DeserializerTests/TOMLDeserializerTests.swift b/Tests/DeserializerTests/TOMLDeserializerTests.swift index 5953631..08a8d59 100644 --- a/Tests/DeserializerTests/TOMLDeserializerTests.swift +++ b/Tests/DeserializerTests/TOMLDeserializerTests.swift @@ -2,11 +2,22 @@ import Foundation import Deserializer import XCTest +#if os(Windows) +private let kSeparator: Character = "\\" +#else +private let kSeparator: Character = "/" +#endif + @available(iOS 10.0, *) @available(macOS 10.12, *) final class TOMLDeserializerTests: XCTestCase { private var directory: String { - return "/" + #file.split(separator: "/").dropLast().joined(separator: "/") + ( + (#file.first == "/" ? [""] : []) + + #file.split(separator: kSeparator).dropLast() + + ["valid_fixtures"] + ) + .joined(separator: "\(kSeparator)") } func formatDateComponent(_ dc: DateComponents) -> String { func pad(_ i: Int) -> String { @@ -54,7 +65,9 @@ final class TOMLDeserializerTests: XCTestCase { return formatDateComponent(components) } - return "\(value)" + // On Windows, `\n` in a file will become '\r\n'. This is handled in our TOML parser correctly, + // but here we need to handle it separately. + return "\(value)".replacingOccurrences(of: "\r\n", with: "\n") } return stringify(table) as! [String: Any] @@ -97,8 +110,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_array_empty() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-empty.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-empty.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-empty.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-empty.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) let jsonObject = try JSONSerialization.jsonObject(with: jsonData) @@ -108,8 +121,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_array_nospaces() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-nospaces.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-nospaces.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-nospaces.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-nospaces.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -120,8 +133,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_array_string_quote_comma_2() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-string-quote-comma-2.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-string-quote-comma-2.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-string-quote-comma-2.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-string-quote-comma-2.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -132,8 +145,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_array_string_quote_comma() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-string-quote-comma.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-string-quote-comma.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-string-quote-comma.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-string-quote-comma.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -144,8 +157,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_array_string_with_comma() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-string-with-comma.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-string-with-comma.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-string-with-comma.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-string-with-comma.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -156,8 +169,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_array_table_array_string_backslash() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-table-array-string-backslash.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/array-table-array-string-backslash.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-table-array-string-backslash.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-table-array-string-backslash.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -168,8 +181,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_arrays_hetergeneous() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/arrays-hetergeneous.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/arrays-hetergeneous.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)arrays-hetergeneous.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)arrays-hetergeneous.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -180,8 +193,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_arrays_nested() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/arrays-nested.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/arrays-nested.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)arrays-nested.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)arrays-nested.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -192,8 +205,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_arrays() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/arrays.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/arrays.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)arrays.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)arrays.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) let jsonObject = try JSONSerialization.jsonObject(with: jsonData) @@ -203,8 +216,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_bool() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/bool.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/bool.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)bool.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)bool.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -215,8 +228,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_comments_at_eof() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/comments-at-eof.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/comments-at-eof.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)comments-at-eof.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)comments-at-eof.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -227,8 +240,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_comments_at_eof2() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/comments-at-eof2.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/comments-at-eof2.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)comments-at-eof2.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)comments-at-eof2.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -239,8 +252,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_comments_everywhere() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/comments-everywhere.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/comments-everywhere.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)comments-everywhere.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)comments-everywhere.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -251,8 +264,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_datetime_timezone() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/datetime-timezone.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/datetime-timezone.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)datetime-timezone.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)datetime-timezone.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -263,8 +276,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_datetime() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/datetime.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/datetime.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)datetime.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)datetime.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -275,8 +288,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_dotted_keys() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/dotted-keys.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/dotted-keys.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)dotted-keys.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)dotted-keys.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -287,8 +300,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_double_quote_escape() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/double-quote-escape.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/double-quote-escape.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)double-quote-escape.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)double-quote-escape.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -299,8 +312,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_empty() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/empty.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/empty.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)empty.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)empty.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -311,8 +324,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_escaped_escape() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/escaped-escape.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/escaped-escape.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)escaped-escape.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)escaped-escape.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -323,8 +336,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_example() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/example.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/example.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)example.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)example.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -335,8 +348,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_exponent_part_float() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/exponent-part-float.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/exponent-part-float.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)exponent-part-float.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)exponent-part-float.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -347,8 +360,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_float_exponent() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/float-exponent.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/float-exponent.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-exponent.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-exponent.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -359,8 +372,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_float_underscore() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/float-underscore.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/float-underscore.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-underscore.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-underscore.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -371,8 +384,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_float() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/float.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/float.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -383,8 +396,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_implicit_and_explicit_before() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/implicit-and-explicit-before.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/implicit-and-explicit-before.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)implicit-and-explicit-before.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)implicit-and-explicit-before.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -395,8 +408,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_implicit_groups() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/implicit-groups.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/implicit-groups.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)implicit-groups.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)implicit-groups.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -408,8 +421,8 @@ final class TOMLDeserializerTests: XCTestCase { /* the '-' in -nan only prints in Swift 5, re-enable it when migrate func test_infinity_and_nan() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/infinity-and-nan.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/infinity-and-nan.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)infinity-and-nan.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)infinity-and-nan.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -421,8 +434,8 @@ final class TOMLDeserializerTests: XCTestCase { */ func test_inline_table_array() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/inline-table-array.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/inline-table-array.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)inline-table-array.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)inline-table-array.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -433,8 +446,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_inline_table() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/inline-table.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/inline-table.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)inline-table.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)inline-table.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -445,8 +458,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_integer_underscore() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/integer-underscore.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/integer-underscore.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer-underscore.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer-underscore.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -457,8 +470,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_integer() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/integer.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/integer.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -469,8 +482,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_key_equals_nospace() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/key-equals-nospace.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/key-equals-nospace.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-equals-nospace.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-equals-nospace.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -481,8 +494,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_key_numeric() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/key-numeric.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/key-numeric.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-numeric.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-numeric.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -493,8 +506,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_key_space() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/key-space.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/key-space.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-space.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-space.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -505,8 +518,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_key_special_chars() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/key-special-chars.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/key-special-chars.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-special-chars.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-special-chars.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -517,8 +530,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_keys_with_dots() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/keys-with-dots.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/keys-with-dots.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)keys-with-dots.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)keys-with-dots.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -529,8 +542,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_local_date() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/local-date.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/local-date.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)local-date.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)local-date.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -541,8 +554,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_local_datetime() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/local-datetime.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/local-datetime.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)local-datetime.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)local-datetime.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -553,8 +566,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_local_time() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/local-time.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/local-time.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)local-time.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)local-time.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -565,8 +578,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_long_float() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/long-float.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/long-float.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)long-float.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)long-float.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -577,8 +590,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_long_integer() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/long-integer.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/long-integer.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)long-integer.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)long-integer.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -589,8 +602,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_multiline_string() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/multiline-string.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/multiline-string.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)multiline-string.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)multiline-string.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -601,8 +614,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_newline_crlf() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/newline-crlf.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/newline-crlf.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)newline-crlf.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)newline-crlf.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -613,8 +626,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_newline_lf() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/newline-lf.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/newline-lf.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)newline-lf.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)newline-lf.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -625,8 +638,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_non_dec_integers() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/non-dec-integers.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/non-dec-integers.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)non-dec-integers.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)non-dec-integers.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -642,8 +655,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_raw_multiline_string() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/raw-multiline-string.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/raw-multiline-string.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)raw-multiline-string.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)raw-multiline-string.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -654,8 +667,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_raw_string() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/raw-string.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/raw-string.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)raw-string.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)raw-string.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -666,8 +679,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_string_empty() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-empty.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-empty.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-empty.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-empty.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -678,8 +691,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_string_escapes() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-escapes.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-escapes.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-escapes.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-escapes.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -690,8 +703,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_string_nl() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-nl.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-nl.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-nl.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-nl.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -702,8 +715,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_string_simple() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-simple.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-simple.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-simple.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-simple.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -714,8 +727,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_string_with_pound() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-with-pound.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/string-with-pound.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-with-pound.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-with-pound.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -726,8 +739,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_array_implicit() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-implicit.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-implicit.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-implicit.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-implicit.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -738,8 +751,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_array_many() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-many.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-many.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-many.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-many.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -750,8 +763,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_array_nest() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-nest.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-nest.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-nest.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-nest.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -762,8 +775,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_array_one() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-one.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-one.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-one.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-one.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -774,8 +787,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_array_table_array() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-table-array.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-array-table-array.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-table-array.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-table-array.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -786,8 +799,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_empty() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-empty.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-empty.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-empty.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-empty.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -798,8 +811,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_no_eol() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-no-eol.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-no-eol.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-no-eol.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-no-eol.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -810,8 +823,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_sub_empty() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-sub-empty.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-sub-empty.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-sub-empty.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-sub-empty.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -822,8 +835,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_whitespace() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-whitespace.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-whitespace.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-whitespace.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-whitespace.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -834,8 +847,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_with_literal_string() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-with-literal-string.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-with-literal-string.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-with-literal-string.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-with-literal-string.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -846,8 +859,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_with_pound() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-with-pound.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-with-pound.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-with-pound.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-with-pound.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -858,8 +871,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_table_with_single_quotes() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-with-single-quotes.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/table-with-single-quotes.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-with-single-quotes.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-with-single-quotes.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -870,8 +883,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_underscored_float() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/underscored-float.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/underscored-float.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)underscored-float.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)underscored-float.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -882,8 +895,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_underscored_integer() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/underscored-integer.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/underscored-integer.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)underscored-integer.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)underscored-integer.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -894,8 +907,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_unicode_escape() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/unicode-escape.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/unicode-escape.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)unicode-escape.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)unicode-escape.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) @@ -906,8 +919,8 @@ final class TOMLDeserializerTests: XCTestCase { } func test_unicode_literal() throws { - let jsonURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/unicode-literal.json", isDirectory: false) - let tomlURL = URL(fileURLWithPath: "\(self.directory)/valid_fixtures/unicode-literal.toml", isDirectory: false) + let jsonURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)unicode-literal.json", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)unicode-literal.toml", isDirectory: false) let jsonData = try Data(contentsOf: jsonURL) let tomlData = try Data(contentsOf: tomlURL) diff --git a/Tests/DeserializerTests/TOMLInvalidationTests.swift b/Tests/DeserializerTests/TOMLInvalidationTests.swift index 6caa73f..047166e 100644 --- a/Tests/DeserializerTests/TOMLInvalidationTests.swift +++ b/Tests/DeserializerTests/TOMLInvalidationTests.swift @@ -1,577 +1,589 @@ import XCTest import Deserializer +import Foundation + +#if os(Windows) +private let kSeparator: Character = "\\" +#else +private let kSeparator: Character = "/" +#endif final class TOMLInvalidationTests: XCTestCase { private var directory: String { - return "/" + #file.split(separator: "/").dropLast().joined(separator: "/") + ( + (#file.first == "/" ? [""] : []) + + #file.split(separator: kSeparator).dropLast() + + ["invalid_fixtures"] + ) + .joined(separator: "\(kSeparator)") } func test_array_of_tables_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/array-of-tables-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-of-tables-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_array_of_tables_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/array-of-tables-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)array-of-tables-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_bare_key_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/bare-key-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)bare-key-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_bare_key_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/bare-key-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)bare-key-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_bare_key_3() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/bare-key-3.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)bare-key-3.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_datetime_malformed_no_leads() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/datetime-malformed-no-leads.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)datetime-malformed-no-leads.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_datetime_malformed_no_secs() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/datetime-malformed-no-secs.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)datetime-malformed-no-secs.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_datetime_malformed_no_t() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/datetime-malformed-no-t.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)datetime-malformed-no-t.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_datetime_malformed_with_milli() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/datetime-malformed-with-milli.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)datetime-malformed-with-milli.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_duplicate_key_table() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/duplicate-key-table.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)duplicate-key-table.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_duplicate_keys() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/duplicate-keys.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)duplicate-keys.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_duplicate_tables() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/duplicate-tables.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)duplicate-tables.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_empty_implicit_table() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/empty-implicit-table.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)empty-implicit-table.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_empty_table() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/empty-table.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)empty-table.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_leading_zero_neg() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-leading-zero-neg.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-leading-zero-neg.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_leading_zero_pos() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-leading-zero-pos.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-leading-zero-pos.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_leading_zero() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-leading-zero.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-leading-zero.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_no_leading_zero() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-no-leading-zero.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-no-leading-zero.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_no_trailing_digits() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-no-trailing-digits.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-no-trailing-digits.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_underscore_after_point() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-underscore-after-point.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-underscore-after-point.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_underscore_after() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-underscore-after.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-underscore-after.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_underscore_before_point() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-underscore-before-point.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-underscore-before-point.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_float_underscore_before() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/float-underscore-before.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)float-underscore-before.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_inline_table_linebreak() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/inline-table-linebreak.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)inline-table-linebreak.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_int_0_padded() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/int-0-padded.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)int-0-padded.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_integer_leading_zero_neg() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/integer-leading-zero-neg.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer-leading-zero-neg.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_integer_leading_zero_pos() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/integer-leading-zero-pos.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer-leading-zero-pos.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_integer_leading_zero() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/integer-leading-zero.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer-leading-zero.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_integer_underscore_after() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/integer-underscore-after.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer-underscore-after.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_integer_underscore_before() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/integer-underscore-before.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer-underscore-before.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_integer_underscore_double() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/integer-underscore-double.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)integer-underscore-double.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_after_array() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-after-array.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-after-array.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_after_table() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-after-table.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-after-table.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_empty() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-empty.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-empty.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_hash() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-hash.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-hash.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_newline() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-newline.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-newline.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_no_eol() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-no-eol.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-no-eol.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_open_bracket() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-open-bracket.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-open-bracket.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_single_open_bracket() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-single-open-bracket.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-single-open-bracket.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_space() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-space.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-space.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_start_bracket() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-start-bracket.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-start-bracket.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_two_equals() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-two-equals.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-two-equals.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_key_value_pair_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/key-value-pair-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)key-value-pair-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_llbrace() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/llbrace.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)llbrace.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_multi_line_inline_table() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/multi-line-inline-table.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)multi-line-inline-table.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_multiple_dot_key() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/multiple-dot-key.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)multiple-dot-key.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_multiple_key() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/multiple-key.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)multiple-key.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_no_key_name() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/no-key-name.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)no-key-name.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_non_dec_integers() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/non-dec-integers.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)non-dec-integers.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_rrbrace() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/rrbrace.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)rrbrace.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_bad_byte_escape() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-bad-byte-escape.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-bad-byte-escape.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_bad_codepoint() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-bad-codepoint.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-bad-codepoint.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_bad_escape() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-bad-escape.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-bad-escape.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_bad_slash_escape() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-bad-slash-escape.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-bad-slash-escape.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_bad_uni_esc() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-bad-uni-esc.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-bad-uni-esc.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_control_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-control-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-control-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_control_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-control-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-control-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_control_3() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-control-3.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-control-3.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_control_4() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-control-4.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-control-4.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_multiline_control_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-multiline-control-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-multiline-control-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_multiline_control_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-multiline-control-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-multiline-control-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_multiline_control_3() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-multiline-control-3.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-multiline-control-3.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_multiline_control_4() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-multiline-control-4.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-multiline-control-4.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_multiline_out_of_range_unicode_escape_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-multiline-out-of-range-unicode-escape-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-multiline-out-of-range-unicode-escape-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_multiline_out_of_range_unicode_escape_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-multiline-out-of-range-unicode-escape-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-multiline-out-of-range-unicode-escape-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_multiline_unknown_escape() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-multiline-unknown-escape.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-multiline-unknown-escape.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_out_of_range_unicode_escape_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-out-of-range-unicode-escape-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-out-of-range-unicode-escape-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_out_of_range_unicode_escape_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-out-of-range-unicode-escape-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-out-of-range-unicode-escape-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_basic_unknown_escape() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-basic-unknown-escape.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-basic-unknown-escape.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_byte_escapes() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-byte-escapes.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-byte-escapes.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_literal_control_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-literal-control-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-literal-control-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_literal_control_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-literal-control-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-literal-control-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_literal_control_3() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-literal-control-3.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-literal-control-3.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_literal_control_4() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-literal-control-4.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-literal-control-4.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_literal_multiline_control_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-literal-multiline-control-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-literal-multiline-control-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_literal_multiline_control_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-literal-multiline-control-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-literal-multiline-control-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_literal_multiline_control_3() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-literal-multiline-control-3.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-literal-multiline-control-3.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_literal_multiline_control_4() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-literal-multiline-control-4.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-literal-multiline-control-4.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_string_no_close() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/string-no-close.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)string-no-close.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_1() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-1.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-1.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_2() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-2.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-2.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_array_implicit() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-array-implicit.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-implicit.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_array_malformed_bracket() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-array-malformed-bracket.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-malformed-bracket.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_array_malformed_empty() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-array-malformed-empty.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-array-malformed-empty.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_empty() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-empty.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-empty.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_nested_brackets_close() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-nested-brackets-close.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-nested-brackets-close.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_nested_brackets_open() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-nested-brackets-open.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-nested-brackets-open.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_whitespace() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-whitespace.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-whitespace.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_table_with_pound() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/table-with-pound.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)table-with-pound.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_text_after_array_entries() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/text-after-array-entries.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)text-after-array-entries.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_text_after_integer() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/text-after-integer.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)text-after-integer.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_text_after_string() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/text-after-string.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)text-after-string.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_text_after_table() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/text-after-table.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)text-after-table.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_text_before_array_separator() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/text-before-array-separator.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)text-before-array-separator.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) } func test_text_in_array() throws { - let tomlURL = URL(fileURLWithPath: "\(self.directory)/invalid_fixtures/text-in-array.toml", isDirectory: false) + let tomlURL = URL(fileURLWithPath: "\(self.directory)\(kSeparator)text-in-array.toml", isDirectory: false) let tomlData = try Data(contentsOf: tomlURL) XCTAssertThrowsError(try TOMLDeserializer.tomlTable(with: tomlData)) }