File tree Expand file tree Collapse file tree
commonMain/kotlin/net/sergeych/mp_tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ plugins {
77}
88
99group = " net.sergeych"
10- version = " 1.4.4-SNAPSHOT "
10+ version = " 1.4.3 "
1111
1212val serialization_version = " 1.3.3"
1313
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -75,21 +75,4 @@ fun Number.withThousandsSeparator(separator: String=" "): String {
7575 }
7676 }
7777 return result.toString()
78- }
79-
80- private val idFirstChars = " _qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"
81- private val idChars = " 1234567890$" + idFirstChars
82-
83- /* *
84- * Generate a random string of a given length that contains only url-friendly characters
85- * and starts with a letter of `_` character.
86- *
87- * If length < 1 returns empty string.
88- */
89- fun randomId (length : Int ): String {
90- if ( length < 1 ) return " "
91- val result = mutableListOf (idFirstChars.random())
92- var l = length
93- while (-- l > 0 ) result + = idChars.random()
94- return result.joinToString(" " )
9578}
Original file line number Diff line number Diff line change @@ -77,17 +77,6 @@ class TestTools {
7777 assertEquals(offset, haystack.indexOf(needle))
7878 }
7979
80- @Test
81- fun searchInString () {
82- val offset = 1171
83- val needle = " Fake vaccine kills"
84- assertEquals(17 , randomId(17 ).length)
85- val haystack = randomId(offset) + needle + randomId(offset/ 3 )
86- assertEquals(offset, haystack.fastSearch(needle))
87- assertEquals(offset, haystack.fastSearch(needle, offset/ 2 ))
88- assertEquals(- 1 , haystack.fastSearch(needle, offset+ 1 ))
89- }
90-
9180 @OptIn(ExperimentalCoroutinesApi ::class )
9281 @Test
9382 fun reentrantMutex () = runTest {
You can’t perform that action at this time.
0 commit comments