Skip to content

Commit 0d421c4

Browse files
test: close the stream
fixes #29
1 parent 389a8b3 commit 0d421c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/CoreApi/FileSystemApiTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ public void Read_With_Offset()
5555
var ipfs = TestFixture.Ipfs;
5656
var indata = new MemoryStream(new byte[] { 10, 20, 30 });
5757
var node = ipfs.FileSystem.AddAsync(indata).Result;
58-
var outdata = ipfs.FileSystem.ReadFileAsync(node.Id, offset: 1).Result;
59-
Assert.AreEqual(20, outdata.ReadByte());
58+
using (var outdata = ipfs.FileSystem.ReadFileAsync(node.Id, offset: 1).Result)
59+
{
60+
Assert.AreEqual(20, outdata.ReadByte());
61+
}
6062
}
6163

6264
[TestMethod]

0 commit comments

Comments
 (0)