summaryrefslogtreecommitdiff
path: root/src/main/kotlin/me/kyren223/trident/tests
diff options
context:
space:
mode:
authorKyren223 <ulmliad223@gmail.com>2024-08-23 00:31:20 +0300
committerKyren223 <ulmliad223@gmail.com>2024-08-23 00:32:15 +0300
commit7451f83d6685073d10df9bae5c957fdb55dcdc53 (patch)
treedb9a10dcb117263aebcf03b74b5ad68d466d5287 /src/main/kotlin/me/kyren223/trident/tests
parent43346334c56e47e619d40108a07dd8dc651b11fd (diff)
fix: issues with IdeaVim version 2.16.0, everything should work now
Diffstat (limited to 'src/main/kotlin/me/kyren223/trident/tests')
-rw-r--r--src/main/kotlin/me/kyren223/trident/tests/MappingsExpansionTest.kt82
-rw-r--r--src/main/kotlin/me/kyren223/trident/tests/SplitTest.kt120
2 files changed, 101 insertions, 101 deletions
diff --git a/src/main/kotlin/me/kyren223/trident/tests/MappingsExpansionTest.kt b/src/main/kotlin/me/kyren223/trident/tests/MappingsExpansionTest.kt
index 0b66c4b..7fe33ad 100644
--- a/src/main/kotlin/me/kyren223/trident/tests/MappingsExpansionTest.kt
+++ b/src/main/kotlin/me/kyren223/trident/tests/MappingsExpansionTest.kt
@@ -1,42 +1,42 @@
-package me.kyren223.trident.tests
-
-import org.junit.Test
-
-class MappingsExpansionTest {
- @Test
- fun testExpand() {
- val mappings = mapOf(
- "\$A" to "A",
- "\$BB" to "B",
- "\$CCC" to "C",
- "\$DDD" to "D",
- "\$EEE" to "E",
- "\$FFFFF" to "F",
- "\$GG" to "G",
- "\$UUU" to "U",
- "\$VVVV" to "V",
- "\$LLLLLL" to "L",
- "\$MM" to "M",
- "\$NN" to "N",
- "\$OOO" to "O",
- "\$PPP" to "P",
- "\$QQQQ" to "Q",
- "\$R" to "R",
- "\$WWW" to "W",
- "\$XX" to "X",
- "\$HI" to "H",
- "\$IJ" to "I",
- "\$JetBrains" to "J",
- "\$Krypton" to "K",
- "\$Soft" to "S",
- "\$Tnt" to "T",
- "\$Ycombinator" to "Y",
- "\$Zig" to "Z",
- ).toList().sortedByDescending { it.first.length }
-
- mappings.forEach { (key, value) ->
- println("$key -> $value")
- }
-
- }
+package me.kyren223.trident.tests
+
+import org.junit.Test
+
+class MappingsExpansionTest {
+ @Test
+ fun testExpand() {
+ val mappings = mapOf(
+ "\$A" to "A",
+ "\$BB" to "B",
+ "\$CCC" to "C",
+ "\$DDD" to "D",
+ "\$EEE" to "E",
+ "\$FFFFF" to "F",
+ "\$GG" to "G",
+ "\$UUU" to "U",
+ "\$VVVV" to "V",
+ "\$LLLLLL" to "L",
+ "\$MM" to "M",
+ "\$NN" to "N",
+ "\$OOO" to "O",
+ "\$PPP" to "P",
+ "\$QQQQ" to "Q",
+ "\$R" to "R",
+ "\$WWW" to "W",
+ "\$XX" to "X",
+ "\$HI" to "H",
+ "\$IJ" to "I",
+ "\$JetBrains" to "J",
+ "\$Krypton" to "K",
+ "\$Soft" to "S",
+ "\$Tnt" to "T",
+ "\$Ycombinator" to "Y",
+ "\$Zig" to "Z",
+ ).toList().sortedByDescending { it.first.length }
+
+ mappings.forEach { (key, value) ->
+ println("$key -> $value")
+ }
+
+ }
} \ No newline at end of file
diff --git a/src/main/kotlin/me/kyren223/trident/tests/SplitTest.kt b/src/main/kotlin/me/kyren223/trident/tests/SplitTest.kt
index e4ea477..586fef1 100644
--- a/src/main/kotlin/me/kyren223/trident/tests/SplitTest.kt
+++ b/src/main/kotlin/me/kyren223/trident/tests/SplitTest.kt
@@ -1,61 +1,61 @@
-package me.kyren223.trident.tests
-
-import org.junit.Test
-
-class SplitTest {
-
- @Test
- fun testSplit() {
- val filenameAndExtension = "SplitTest.kt"
- val filename = "SplitTest"
- val dotfile = ".ideavimrc"
-
- val split = filenameAndExtension.split(".")
- assert(split.size == 2)
- assert(split[0] == filename)
- assert(split[1] == "kt")
-
- val split2 = filename.split(".")
- assert(split2.size == 1)
- assert(split2[0] == filename)
-
- val split3 = dotfile.split(".")
- assert(split3.size == 2)
- assert(split3[0] == "")
- assert(split3[1] == "ideavimrc")
-
-
- }
-
- @Test
- fun testSplit2() {
- val path = "C:/Users/Owner/Projects/Trident/src/main/kotlin/me/kyren223/trident/tests/SplitTest.kt"
- testPath(path, "SplitTest", "kt")
- testPath("SplitTest.kt", "SplitTest", "kt")
- testPath("SplitTest", "SplitTest", null)
- testPath(".ideavimrc", null, "ideavimrc")
- testPath("build.gradle.kts", "build.gradle", "kts")
-
- }
-
- private fun testPath(path: String, filename: String?, extension: String?) {
-
- val fullFilename = path.split("/").last()
- println("fullFilename: $fullFilename")
- val lastDot = fullFilename.lastIndexOf(".")
- val noExtension = lastDot == -1
-
- val filename2 = if (noExtension) fullFilename else {
- fullFilename.substring(0, lastDot).ifEmpty { null }
- }
- val extension2 = if (noExtension) null else fullFilename.substring(lastDot + 1)
-
- println("filename: $filename")
- println("extension: $extension")
- println("filename2: $filename2")
- println("extension2: $extension2")
-
- assert(filename2 == filename)
- assert(extension2 == extension)
- }
+package me.kyren223.trident.tests
+
+import org.junit.Test
+
+class SplitTest {
+
+ @Test
+ fun testSplit() {
+ val filenameAndExtension = "SplitTest.kt"
+ val filename = "SplitTest"
+ val dotfile = ".ideavimrc"
+
+ val split = filenameAndExtension.split(".")
+ assert(split.size == 2)
+ assert(split[0] == filename)
+ assert(split[1] == "kt")
+
+ val split2 = filename.split(".")
+ assert(split2.size == 1)
+ assert(split2[0] == filename)
+
+ val split3 = dotfile.split(".")
+ assert(split3.size == 2)
+ assert(split3[0] == "")
+ assert(split3[1] == "ideavimrc")
+
+
+ }
+
+ @Test
+ fun testSplit2() {
+ val path = "C:/Users/Owner/Projects/Trident/src/main/kotlin/me/kyren223/trident/tests/SplitTest.kt"
+ testPath(path, "SplitTest", "kt")
+ testPath("SplitTest.kt", "SplitTest", "kt")
+ testPath("SplitTest", "SplitTest", null)
+ testPath(".ideavimrc", null, "ideavimrc")
+ testPath("build.gradle.kts", "build.gradle", "kts")
+
+ }
+
+ private fun testPath(path: String, filename: String?, extension: String?) {
+
+ val fullFilename = path.split("/").last()
+ println("fullFilename: $fullFilename")
+ val lastDot = fullFilename.lastIndexOf(".")
+ val noExtension = lastDot == -1
+
+ val filename2 = if (noExtension) fullFilename else {
+ fullFilename.substring(0, lastDot).ifEmpty { null }
+ }
+ val extension2 = if (noExtension) null else fullFilename.substring(lastDot + 1)
+
+ println("filename: $filename")
+ println("extension: $extension")
+ println("filename2: $filename2")
+ println("extension2: $extension2")
+
+ assert(filename2 == filename)
+ assert(extension2 == extension)
+ }
} \ No newline at end of file