[Swift] Migrate to use Swift Testing (#9076)

* Migrating from Xctests to swift testing

This migrates to the new Swift testing framework,
which would allow us to always use the latest tech
from swift moving forward.

* Updates flag to make sure that Wasm testing works
This commit is contained in:
mustiikhalil
2026-05-08 03:49:41 +02:00
committed by GitHub
parent e6bbb3d22e
commit 392165432a
21 changed files with 1054 additions and 883 deletions

View File

@@ -14,14 +14,15 @@
* limitations under the License.
*/
import XCTest
import Testing
@testable import FlatBuffers
final class FlatBuffersDoubleTests: XCTestCase {
struct FlatBuffersDoubleTests {
let country = "Norway"
@Test
func testCreateFinish() {
var b = FlatBufferBuilder(initialSize: 16)
let countryOff = CountryDouble.createCountry(
@@ -38,9 +39,10 @@ final class FlatBuffersDoubleTests: XCTestCase {
97, 121, 0, 0,
]
// swiftformat:enable all
XCTAssertEqual(b.sizedByteArray, v)
#expect(b.sizedByteArray == v)
}
@Test
func testCreateFinishWithPrefix() {
var b = FlatBufferBuilder(initialSize: 16)
let countryOff = CountryDouble.createCountry(
@@ -57,7 +59,7 @@ final class FlatBuffersDoubleTests: XCTestCase {
0, 6, 0, 0, 0, 78, 111, 114, 119, 97, 121, 0, 0,
]
// swiftformat:enable all
XCTAssertEqual(b.sizedByteArray, v)
#expect(b.sizedByteArray == v)
}
}