diff --git a/Swift/bp3d-protoc.xcodeproj/project.xcworkspace/xcuserdata/yuri.xcuserdatad/UserInterfaceState.xcuserstate b/Swift/bp3d-protoc.xcodeproj/project.xcworkspace/xcuserdata/yuri.xcuserdatad/UserInterfaceState.xcuserstate index 7214371..25c9e0c 100644 Binary files a/Swift/bp3d-protoc.xcodeproj/project.xcworkspace/xcuserdata/yuri.xcuserdatad/UserInterfaceState.xcuserstate and b/Swift/bp3d-protoc.xcodeproj/project.xcworkspace/xcuserdata/yuri.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Swift/testprogTests/ListsTests.swift b/Swift/testprogTests/ListsTests.swift index d26237c..45fe3e7 100644 --- a/Swift/testprogTests/ListsTests.swift +++ b/Swift/testprogTests/ListsTests.swift @@ -76,4 +76,21 @@ final class ListsTests: XCTestCase { try assertSpanRun(msg.data); } + func testDataset() throws { + var buffer = DataBuffer(); + var list = ListsDatasetRuns(DataBuffer()); + try writeSpanRun({ msg in try list.writeItem(msg) }); + try writeSpanRun({ msg in try list.writeItem(msg) }); + try writeSpanRun({ msg in try list.writeItem(msg) }); + try ListsDataset.write(input: ListsDataset(runs: list), to: &buffer); + let msg = try ListsDataset.from(slice: buffer); + XCTAssertEqual(msg.size, buffer.size); + let data = msg.data; + XCTAssertEqual(data.runs.count, 3); + let items = try data.runs.toArray(); + try assertSpanRun(items[0]); + try assertSpanRun(items[1]); + try assertSpanRun(items[2]); + } + }