Added a test for locks while writing and deleting a file

This commit is contained in:
Panayot Cankov
2015-11-12 15:23:48 +02:00
committed by Hristo Deshev
parent 52ab4f85e3
commit a874b9f36c

View File

@@ -598,3 +598,14 @@ export function test_FSEntity_Properties() {
file.remove();
}
export function test_UnlockAfterWrite(done) {
var file = fs.knownFolders.documents().getFile("Test_File_Lock.txt");
file.writeText("Hello World!").then(() => {
return file.readText();
}).then(value => {
TKUnit.assert(value === "Hello World!");
return file.remove();
}).then(() => done())
.catch(done);
}