Skip to content

Commit 377126c

Browse files
committed
[Tests] Fix SubStreamReader tests
1 parent 4ee9246 commit 377126c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Tests/Stream/SubStreamReader/main.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@ import Test
22
@testable import Stream
33

44
test.case("LimitedBy") {
5-
let stream = ByteArrayInputStream([UInt8]("Hello, World!".utf8))
5+
let stream = ByteArrayInputStream("Hello, World!") as StreamReader
66
let hello = try await stream.withSubStreamReader(limitedBy: 5) { stream in
77
return try await stream.readUntilEnd(as: String.self)
88
}
9-
try stream.consume(count: 2)
9+
try await stream.consume(count: 2)
1010
let world = try await stream.readUntilEnd(as: String.self)
1111
expect(hello == "Hello")
1212
expect(world == "World!")
1313
}
1414

1515
test.case("SizedBy") {
1616
let bytes = [0x00, 0x05] + [UInt8]("Hello, World!".utf8)
17-
let stream = ByteArrayInputStream(bytes)
17+
let stream = ByteArrayInputStream(bytes) as StreamReader
1818
let hello = try await stream.withSubStreamReader(sizedBy: UInt16.self)
1919
{ stream in
2020
return try await stream.readUntilEnd(as: String.self)
2121
}
22-
try stream.consume(count: 2)
22+
try await stream.consume(count: 2)
2323
let world = try await stream.readUntilEnd(as: String.self)
2424
expect(hello == "Hello")
2525
expect(world == "World!")
2626
}
2727

2828
test.case("SizedByIncludingHeader") {
2929
let bytes = [0x00, 0x07] + [UInt8]("Hello, World!".utf8)
30-
let stream = ByteArrayInputStream(bytes)
30+
let stream = ByteArrayInputStream(bytes) as StreamReader
3131
let hello = try await stream.withSubStreamReader(
3232
sizedBy: UInt16.self,
3333
includingHeader: true)
3434
{ stream in
3535
return try await stream.readUntilEnd(as: String.self)
3636
}
37-
try stream.consume(count: 2)
37+
try await stream.consume(count: 2)
3838
let world = try await stream.readUntilEnd(as: String.self)
3939
expect(hello == "Hello")
4040
expect(world == "World!")

0 commit comments

Comments
 (0)