-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test on other targets in addition to JVM and Android
- Loading branch information
Showing
3 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package korlibs.io.file.std | ||
|
||
import korlibs.io.file.* | ||
import korlibs.io.stream.* | ||
import kotlin.test.* | ||
|
||
class AppendBaseTest { | ||
companion object { | ||
suspend fun _testAppendVfs(file: VfsFile) { | ||
file.delete() | ||
try { | ||
file.openUse(VfsOpenMode.APPEND) { | ||
writeString("hello") | ||
} | ||
file.openUse(VfsOpenMode.APPEND) { | ||
writeString(" world") | ||
} | ||
assertEquals("hello world", file.readString()) | ||
} finally { | ||
file.delete() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package korlibs.io.file.std | ||
|
||
import korlibs.io.async.* | ||
import korlibs.platform.* | ||
import kotlin.test.* | ||
|
||
class LocalVfsAppendTest { | ||
@Test | ||
fun test() = suspendTest(cond = { localVfs(StandardPaths.temp).vfs is LocalVfs }) { | ||
AppendBaseTest._testAppendVfs(localVfs(StandardPaths.temp)["file.append.${Platform.rawPlatformName}.txt"]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters