Ivan FB c43072da46
feat(examples): iOS example consumes the generated Swift wrapper
Regenerates Sources/MyTimer/MyTimer.swift via `nimble genbindings_swift`
(replacing the hand-written wrapper) and points the tests at the derived
MyTimerNode class. Proves the generator reproduces the validated
create/version/echo path: build-xcframework.sh + `swift test` pass 2/2 on
the macOS slice.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 16:40:04 +02:00

23 lines
671 B
Swift

import XCTest
@testable import MyTimer
final class MyTimerTests: XCTestCase {
func testCreateVersionEcho() throws {
let node = try MyTimerNode(name: "ios-demo")
XCTAssertEqual(try node.version(), "nim-timer v0.1.0")
let r = try node.echo("hello from Swift", delayMs: 2)
XCTAssertEqual(r.echoed, "hello from Swift")
XCTAssertEqual(r.timerName, "ios-demo") // proves the lib's own state round-tripped
}
func testManyEchoes() throws {
let node = try MyTimerNode(name: "loop")
for i in 0..<200 {
let r = try node.echo("m\(i)")
XCTAssertEqual(r.echoed, "m\(i)")
}
}
}