Skip to content

Commit d8d3727

Browse files
author
Oren (electricessence)
committed
Ensured AsyncEnumerable compatibility in tests.
1 parent edac045 commit d8d3727

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Open.ChannelExtensions.Tests/Program.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,22 @@ await Enumerable
137137
Console.WriteLine();
138138
}
139139

140+
#if NETCOREAPP3_0
141+
{
142+
Console.WriteLine("Async Enumerable test...");
143+
var sw = Stopwatch.StartNew();
144+
await foreach(var e in Enumerable
145+
.Repeat((Func<int, ValueTask<int>>)Delay, repeat)
146+
.Select((t, i) => t(i))
147+
.ToChannelAsync()
148+
.ReadAllAsync())
149+
Dummy(e);
150+
sw.Stop();
151+
Console.WriteLine(sw.Elapsed);
152+
Console.WriteLine();
153+
}
154+
#endif
155+
140156
}
141157

142158
static void Dummy(int i)

0 commit comments

Comments
 (0)