[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,12 +14,13 @@
* limitations under the License.
*/
import XCTest
import Testing
@testable import FlatBuffers
final class FlatBuffersStructsTests: XCTestCase {
struct FlatBuffersStructsTests {
@Test
func testWritingAndMutatingBools() {
var fbb = FlatBufferBuilder()
let start = TestMutatingBool.startTestMutatingBool(&fbb)
@@ -30,11 +31,11 @@ final class FlatBuffersStructsTests: XCTestCase {
var buffer = fbb.sizedBuffer
let testMutatingBool: TestMutatingBool = getRoot(byteBuffer: &buffer)
let property = testMutatingBool.mutableB
XCTAssertEqual(property?.property, false)
#expect(property?.property == false)
property?.mutate(property: false)
XCTAssertEqual(property?.property, false)
#expect(property?.property == false)
property?.mutate(property: true)
XCTAssertEqual(property?.property, true)
#expect(property?.property == true)
}
}