Open transcript file links in explorer
This commit is contained in:
1 parent
3c6e6778fd
commit
e3cca97cdd
6 files changed
+137
-20
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package com.example.aiapp
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNull
|
||||
|
||||
class MarkdownLinksTest {
|
||||
@Test
|
||||
fun `absolute file paths are opened on the session machine`() {
|
||||
assertEquals(
|
||||
"/home/bob/repos/ai app/Main.kt",
|
||||
filePathOf("/home/bob/repos/ai%20app/Main.kt"),
|
||||
)
|
||||
assertEquals("/home/bob/Main.kt", filePathOf("file:///home/bob/Main.kt"))
|
||||
assertEquals("/home/bob/Main.kt", filePathOf("file://localhost/home/bob/Main.kt"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `editor coordinates select the file itself`() {
|
||||
assertEquals("/home/bob/Main.kt", filePathOf("/home/bob/Main.kt:42"))
|
||||
assertEquals("/home/bob/Main.kt", filePathOf("file:///home/bob/Main.kt:42:7#L42"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ordinary links keep their external meaning`() {
|
||||
assertNull(filePathOf("https://example.com/source.kt"))
|
||||
assertNull(filePathOf("docs/source.kt"))
|
||||
assertNull(filePathOf("//example.com/source.kt"))
|
||||
assertNull(filePathOf("file://example.com/source.kt"))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user