-
-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1590 from shogo4405/feature/migration-swift-testing
Migration SwiftTesting.
- Loading branch information
Showing
38 changed files
with
344 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import Foundation | ||
import XCTest | ||
import Testing | ||
import CoreMedia | ||
|
||
@testable import HaishinKit | ||
|
||
final class CMSampleBufferExtensionTests: XCTestCase { | ||
func testIsNotSync() { | ||
@Suite struct CMSampleBufferExtensionTests { | ||
@Test func isNotSync() { | ||
if let video1 = CMVideoSampleBufferFactory.makeSampleBuffer(width: 100, height: 100) { | ||
video1.sampleAttachments[0][.notSync] = 1 | ||
} else { | ||
XCTFail() | ||
Issue.record() | ||
} | ||
|
||
if let video2 = CMVideoSampleBufferFactory.makeSampleBuffer(width: 100, height: 100) { | ||
XCTAssertFalse(video2.isNotSync) | ||
#expect(!video2.isNotSync) | ||
} else { | ||
XCTFail() | ||
Issue.record() | ||
} | ||
} | ||
} |
36 changes: 18 additions & 18 deletions
36
Tests/Extension/ExpressibleByIntegerLiteral+ExtensionTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
import Foundation | ||
import XCTest | ||
import Testing | ||
|
||
@testable import HaishinKit | ||
|
||
final class ExpressibleByIntegerLiteralTests: XCTestCase { | ||
func testInt32() { | ||
XCTAssertEqual(Int32.min.bigEndian.data, Data([128, 0, 0, 0])) | ||
XCTAssertEqual(Int32(32).bigEndian.data, Data([0, 0, 0, 32])) | ||
XCTAssertEqual(Int32.max.bigEndian.data, Data([127, 255, 255, 255])) | ||
@Suite struct ExpressibleByIntegerLiteralTests { | ||
@Test func int32() { | ||
#expect(Int32.min.bigEndian.data == Data([128, 0, 0, 0])) | ||
#expect(Int32(32).bigEndian.data == Data([0, 0, 0, 32])) | ||
#expect(Int32.max.bigEndian.data == Data([127, 255, 255, 255])) | ||
} | ||
|
||
func testUInt32() { | ||
XCTAssertEqual(UInt32.min.bigEndian.data, Data([0, 0, 0, 0])) | ||
XCTAssertEqual(UInt32(32).bigEndian.data, Data([0, 0, 0, 32])) | ||
XCTAssertEqual(UInt32.max.bigEndian.data, Data([255, 255, 255, 255])) | ||
@Test func uInt32() { | ||
#expect(UInt32.min.bigEndian.data == Data([0, 0, 0, 0])) | ||
#expect(UInt32(32).bigEndian.data == Data([0, 0, 0, 32])) | ||
#expect(UInt32.max.bigEndian.data == Data([255, 255, 255, 255])) | ||
} | ||
|
||
func testInt64() { | ||
XCTAssertEqual(Int64.min.bigEndian.data, Data([128, 0, 0, 0, 0, 0, 0, 0])) | ||
XCTAssertEqual(Int64(32).bigEndian.data, Data([0, 0, 0, 0, 0, 0, 0, 32])) | ||
XCTAssertEqual(Int64.max.bigEndian.data, Data([127,255,255, 255, 255, 255, 255, 255])) | ||
@Test func int64() { | ||
#expect(Int64.min.bigEndian.data == Data([128, 0, 0, 0, 0, 0, 0, 0])) | ||
#expect(Int64(32).bigEndian.data == Data([0, 0, 0, 0, 0, 0, 0, 32])) | ||
#expect(Int64.max.bigEndian.data == Data([127,255,255, 255, 255, 255, 255, 255])) | ||
} | ||
|
||
func testUInt64() { | ||
XCTAssertEqual(UInt64.min.bigEndian.data, Data([0, 0, 0, 0, 0, 0, 0, 0])) | ||
XCTAssertEqual(UInt64(32).bigEndian.data, Data([0, 0, 0, 0, 0, 0, 0, 32])) | ||
XCTAssertEqual(UInt64.max.bigEndian.data, Data([255, 255, 255, 255, 255, 255, 255, 255])) | ||
@Test func uInt64() { | ||
#expect(UInt64.min.bigEndian.data == Data([0, 0, 0, 0, 0, 0, 0, 0])) | ||
#expect(UInt64(32).bigEndian.data == Data([0, 0, 0, 0, 0, 0, 0, 32])) | ||
#expect(UInt64.max.bigEndian.data == Data([255, 255, 255, 255, 255, 255, 255, 255])) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import Foundation | ||
import XCTest | ||
import Testing | ||
|
||
@testable import HaishinKit | ||
|
||
final class FoundationExtensionTest: XCTestCase { | ||
func testNSURL() { | ||
@Suite struct FoundationExtensionTest { | ||
@Test func nSURL() { | ||
let url = URL(string: "http://localhost/foo/bar?hello=world!!&foo=bar")! | ||
let dictionary: [String: String] = url.dictionaryFromQuery() | ||
XCTAssertEqual(dictionary["hello"], "world!!") | ||
XCTAssertEqual(dictionary["foo"], "bar") | ||
#expect(dictionary["hello"] == "world!!") | ||
#expect(dictionary["foo"] == "bar") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import Foundation | ||
import XCTest | ||
import Testing | ||
|
||
@testable import HaishinKit | ||
|
||
final class SwiftCoreExtensionTests: XCTestCase { | ||
func testInt32() { | ||
XCTAssertEqual(Int32.min, Int32(data: Int32.min.data)) | ||
XCTAssertEqual(Int32.max, Int32(data: Int32.max.data)) | ||
@Suite struct SwiftCoreExtensionTests { | ||
@Test func int32() { | ||
#expect(Int32.min == Int32(data: Int32.min.data)) | ||
#expect(Int32.max == Int32(data: Int32.max.data)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.