Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Jan 28, 2025
1 parent 3e295c7 commit 02f5105
Show file tree
Hide file tree
Showing 61 changed files with 215 additions and 215 deletions.
10 changes: 5 additions & 5 deletions Tests/AnyCodableTests/AnyCodableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class AnyCodableTests: XCTestCase {
let _: AnyCodable = 10
let _: AnyCodable = 3.4
let _: AnyCodable = "hello"
let _: AnyCodable = ["hi", "there"]
let _: AnyCodable = ["hi": "there"]
let _: AnyCodable = .init(["hi", "there"])
let _: AnyCodable = .init(["hi": "there"])
}

func testEquality() throws {
Expand Down Expand Up @@ -153,12 +153,12 @@ class AnyCodableTests: XCTestCase {
"boolean": true,
"integer": 1,
"string": "string",
"array": [1, 2, 3],
"nested": [
"array": .init([1, 2, 3]),
"nested": .init([
"a": "alpha",
"b": "bravo",
"c": "charlie",
],
]),
]

let result = try testStringFromEncoding(of: dictionary)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class ComponentErrorTests: XCTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class DocumentErrorTests: XCTestCase {

Expand Down
2 changes: 1 addition & 1 deletion Tests/OpenAPIKit30ErrorReportingTests/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
//

import Foundation
import Yams
@preconcurrency import Yams

let testDecoder = YAMLDecoder()
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class JSONReferenceErrorTests: XCTestCase {
func test_referenceFailedToParse() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class OperationErrorTests: XCTestCase {
func test_missingResponses() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class PathsErrorTests: XCTestCase {
func test_missingPaths() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class RequestContentMapErrorTests: XCTestCase {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class RequestContentSchemaErrorTests: XCTestCase {
func test_wrongTypeContentSchemaTypeProperty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class RequestErrorTests: XCTestCase {
func test_wrongTypeRequest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class ResponseErrorTests: XCTestCase {
func test_headerWithContentAndSchema() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class SchemaErrorTests: XCTestCase {
func test_nonIntegerMaximumForIntegerSchema() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class SecuritySchemeErrorTests: XCTestCase {
func test_missingSecuritySchemeError() {
Expand Down
2 changes: 1 addition & 1 deletion Tests/OpenAPIKit30RealSpecSuite/GitHubAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
Expand Down
2 changes: 1 addition & 1 deletion Tests/OpenAPIKit30RealSpecSuite/GoogleBooksAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
Expand Down
2 changes: 1 addition & 1 deletion Tests/OpenAPIKit30RealSpecSuite/PetStoreAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class SwaggerDocSamplesTests: XCTestCase {
func test_allOfExample() throws {
Expand Down
2 changes: 1 addition & 1 deletion Tests/OpenAPIKit30RealSpecSuite/TomTomAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
Expand Down
4 changes: 2 additions & 2 deletions Tests/OpenAPIKit30Tests/ComponentsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ extension ComponentsTests {
)
]
],
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)

let encoded = try orderUnstableTestStringFromEncoding(of: t1)
Expand Down Expand Up @@ -504,7 +504,7 @@ extension ComponentsTests {
)
]
],
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)
)
}
Expand Down
8 changes: 4 additions & 4 deletions Tests/OpenAPIKit30Tests/Content/ContentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ extension ContentTests {

func test_exampleAndSchemaContent_encode() {
let content = OpenAPI.Content(schema: .init(.object(properties: ["hello": .string])),
example: [ "hello": "world" ])
example: .init([ "hello": "world" ]))
let encodedContent = try! orderUnstableTestStringFromEncoding(of: content)

assertJSONEquivalent(
Expand Down Expand Up @@ -260,7 +260,7 @@ extension ContentTests {

func test_examplesAndSchemaContent_encode() {
let content = OpenAPI.Content(schema: .init(.object(properties: ["hello": .string])),
examples: ["hello": .b(OpenAPI.Example(value: .init([ "hello": "world" ])))])
examples: ["hello": .b(OpenAPI.Example(value: .init(.init([ "hello": "world" ]))))])
let encodedContent = try! orderUnstableTestStringFromEncoding(of: content)

assertJSONEquivalent(
Expand Down Expand Up @@ -405,7 +405,7 @@ extension ContentTests {
func test_vendorExtensions_encode() {
let content = OpenAPI.Content(
schema: .init(.string),
vendorExtensions: [ "x-hello": [ "world": 123 ] ]
vendorExtensions: [ "x-hello": .init([ "world": 123 ]) ]
)

let encodedContent = try! orderUnstableTestStringFromEncoding(of: content)
Expand All @@ -428,7 +428,7 @@ extension ContentTests {
func test_vendorExtensions_encode_fixKey() {
let content = OpenAPI.Content(
schema: .init(.string),
vendorExtensions: [ "hello": [ "world": 123 ] ]
vendorExtensions: [ "hello": .init([ "world": 123 ]) ]
)

let encodedContent = try! orderUnstableTestStringFromEncoding(of: content)
Expand Down
12 changes: 6 additions & 6 deletions Tests/OpenAPIKit30Tests/Document/DocumentInfoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ extension DocumentInfoTests {
let license = OpenAPI.Document.Info.License(
name: "MIT",
url: URL(string: "http://website.com")!,
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)

let encodedLicense = try orderUnstableTestStringFromEncoding(of: license)
Expand Down Expand Up @@ -142,7 +142,7 @@ extension DocumentInfoTests {
OpenAPI.Document.Info.License(
name: "MIT",
url: URL(string: "http://website.com")!,
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)
)
}
Expand Down Expand Up @@ -240,7 +240,7 @@ extension DocumentInfoTests {
func test_contact_vendorExtensions_encode() throws {
let contact = OpenAPI.Document.Info.Contact(
email: "email",
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)

let encodedContact = try orderUnstableTestStringFromEncoding(of: contact)
Expand Down Expand Up @@ -276,7 +276,7 @@ extension DocumentInfoTests {
contact,
.init(
email: "email",
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)
)
}
Expand Down Expand Up @@ -508,7 +508,7 @@ extension DocumentInfoTests {
title: "title",
license: .init(name: "license"),
version: "1.0",
vendorExtensions: ["x-speacialFeature": ["hello", "world"]]
vendorExtensions: ["x-speacialFeature": .init(["hello", "world"])]
)

let encodedInfo = try orderUnstableTestStringFromEncoding(of: info)
Expand Down Expand Up @@ -554,7 +554,7 @@ extension DocumentInfoTests {
title: "title",
license: .init(name: "license"),
version: "1.0",
vendorExtensions: ["x-speacialFeature": ["hello", "world"]]
vendorExtensions: ["x-speacialFeature": .init(["hello", "world"])]
)
)
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/OpenAPIKit30Tests/Document/DocumentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ extension DocumentTests {
paths: [:],
components: .noComponents,
externalDocs: .init(url: URL(string: "http://google.com")!),
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)
let encodedDocument = try orderUnstableTestStringFromEncoding(of: document)

Expand Down Expand Up @@ -903,7 +903,7 @@ extension DocumentTests {
paths: [:],
components: .noComponents,
externalDocs: .init(url: URL(string: "http://google.com")!),
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import Foundation
import Yams
@preconcurrency import Yams
import OpenAPIKit30
import XCTest

Expand Down
6 changes: 3 additions & 3 deletions Tests/OpenAPIKit30Tests/Operation/OperationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import XCTest
import OpenAPIKit30
import Yams
@preconcurrency import Yams

final class OperationTests: XCTestCase {
func test_init() {
Expand Down Expand Up @@ -126,7 +126,7 @@ extension OperationTests {
deprecated: true,
security: [[.component(named: "security"): []]],
servers: [.init(url: URL(string: "https://google.com")!)],
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)

let encodedOperation = try orderUnstableTestStringFromEncoding(of: operation)
Expand Down Expand Up @@ -298,7 +298,7 @@ extension OperationTests {
deprecated: true,
security: [[.component(named: "security"): []]],
servers: [.init(url: URL(string: "https://google.com")!)],
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)
)

Expand Down
4 changes: 2 additions & 2 deletions Tests/OpenAPIKit30Tests/Parameter/ParameterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ extension ParameterTests {
context: .path,
schema: .string,
description: "world",
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)

let encodedParameter = try orderUnstableTestStringFromEncoding(of: parameter)
Expand Down Expand Up @@ -880,7 +880,7 @@ extension ParameterTests {
context: .path,
schema: .string,
description: "world",
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)
)
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/OpenAPIKit30Tests/Path Item/PathItemTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ extension PathItemTests {
description: "description",
servers: [OpenAPI.Server(url: URL(string: "http://google.com")!)],
parameters: [.parameter(name: "hello", context: .query, schema: .string)],
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)

let encodedPathItem = try orderUnstableTestStringFromEncoding(of: pathItem)
Expand Down Expand Up @@ -245,7 +245,7 @@ extension PathItemTests {
description: "description",
servers: [OpenAPI.Server(url: URL(string: "http://google.com")!)],
parameters: [.parameter(name: "hello", context: .query, schema: .string)],
vendorExtensions: ["x-specialFeature": ["hello", "world"]]
vendorExtensions: ["x-specialFeature": .init(["hello", "world"])]
)
)
}
Expand Down
Loading

0 comments on commit 02f5105

Please sign in to comment.