close FileInputStream before deleting file in FileOutput test

Otherwise, Windows won't let us delete it.
This commit is contained in:
Joel Dice 2011-01-17 10:33:43 -07:00
parent 4a9ff55060
commit b4941cddbe

View File

@ -25,6 +25,7 @@ public class FileOutput {
while ((c = in.read(buffer, offset, buffer.length - offset)) != -1) {
offset += c;
}
in.close();
if (! "Hello world!\nHello world again!".equals
(new String(buffer, 0, offset)))
@ -32,7 +33,7 @@ public class FileOutput {
throw new RuntimeException();
}
} finally {
new File("test.txt").delete();
expect(new File("test.txt").delete());
}
}