Ilya Gorbunov
30c769c19a
Avoid hitting max argument limit in String(chars)
...
Rewrite CharArray to String conversions to appending chars one by one.
Refine parameter checking in String(chars, offset, length) to adhere to
the common exception contract and document it.
#KT-29003
2019-01-10 23:35:52 +03:00
Ilya Gorbunov
2b699f8f07
Add a test for CharSequence/String.regionMatches
2018-11-01 17:51:24 +03:00
Ilya Gorbunov
ea2c33a532
Extension random() to select random element from a collection
...
Fixes #KT-15539
2018-08-30 16:21:27 +03:00
Ilya Gorbunov
f367322084
Introduce associateWith and associateWithTo functions
...
#KT-13814
2018-08-30 14:58:14 +03:00
Ilya Gorbunov
ed53983e1e
Add support for CASE_INSENSITIVE_ORDER in JS and common
...
#KT-18067
2018-08-15 21:28:54 +03:00
Ilya Gorbunov
6866f5d19a
Move test and cover more cases of string comparison
...
#KT-18067
2018-08-15 21:28:50 +03:00
Toshiaki Kameyama
f05a19aafb
JS stdlib: implement String.compareTo with ignoreCase
...
#KT-18067 Fixed
2018-08-15 21:28:44 +03:00
Neonailol
ede2e227c2
KT-23356 Cross-platform function to convert CharArray slice to String
...
Signed-off-by: Valeriy Zhirnov <neonailol@gmail.com >
2018-05-26 06:06:53 +03:00
Ilya Gorbunov
ecf0d7ec0d
Reformat stdlib tests and samples
...
#KT-5558
2018-04-27 05:28:57 +03:00
Ilya Gorbunov
e21c235bbb
Add or update copyrights in the standard library sources
2018-04-26 21:57:50 +03:00
Vsevolod
510e17246f
KT-16661 Simplify Strings#split
...
Do not search for next occurrence if limit is reached.
2018-01-23 13:29:29 +03:00
Vsevolod
2805371bdc
KT-16661 Provide fast-path for Strings#split with single delimiter
...
Optimize single delimiter split when no matches is found:
Return listOf() of single element instead of adding 'this' to result
because underlying array in ArrayList is created lazily and
by default its size is 16.
Pre-size resulting list in split when limit is known.
2018-01-23 13:29:05 +03:00
Ilya Gorbunov
20b122c1dd
Use kotlin.test.Test instead of org.junit.Test in common stdlib tests
...
(and in jvm-only and js-only tests also)
2017-10-15 17:40:53 +03:00
Ilya Gorbunov
559255f38e
windowed function: add default parameters, drop or keep partial windows, KEEP-11
...
Make step default to 1.
Add partialWindows boolean parameter defaulting to false to control
whether to keep partial windows in the end.
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
c04b0072af
Rename pairwise to zipWithNext, KEEP-11
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
18c7a01ab5
Add tests for windowed and chunked, fix precondition checks
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
c815ccfd6a
Introduce 'pairwise' function, KEEP-11
2017-10-11 19:20:24 +03:00
Ilya Gorbunov
6ae19e03d5
Clean warnings and refactor stdlib tests.
...
Merge RangeJVMTest into RangeTest.
2017-04-18 18:51:20 +03:00
Ilya Gorbunov
dc57d69085
Improve onEach templates.
...
Add new functions to reference API.
Add tests for onEach
#KT-8220
2016-11-30 16:46:56 +03:00
Ilya Gorbunov
6a70761783
Minor: normalize '@Test' annotation casing in all tests.
2016-11-21 18:20:33 +03:00
Ilya Gorbunov
0ac461927c
Minor: Fix TODOs in stdlib tests
2016-10-18 17:13:17 +03:00
Ilya Gorbunov
4b533b297e
reified assertFailsWith available in kotlin-test for JS
...
#KT-11346
2016-04-27 18:22:20 +03:00
Ilya Gorbunov
f564adfdd4
Optimize trivial cases of CharSequence.repeat. Provide CharSequence.repeat for JS.
...
#KT-3064 Fixed
2016-02-26 01:23:30 +03:00
Ilya Gorbunov
3c35395cf7
Minor: refactor some tests to use nested classes.
2016-02-21 04:18:11 +03:00
Ilya Gorbunov
4f1418bb72
Verify index expectations for reduceIndexed/reduceRightIndexed
2016-01-31 02:45:05 +03:00
Gabriel Borges
d58efff974
Add foldIndexed and reduceIndexed groups of functions
...
- foldIndexed, foldRightIndexed, reduceIndexed and reduceRightIndexed have been added, in line with filterIndexed etc.;
- Test cases added appropriately for the new functions.
2016-01-31 02:45:02 +03:00
Ilya Gorbunov
07654eb82b
StdLib cleanup, deprecated symbol usage: size() and length()
2015-11-21 00:54:05 +03:00
Ilya Gorbunov
008a8059cf
Introduce filterIndexed
...
#KT-9502 Fixed
2015-11-11 02:42:52 +03:00
Ilya Gorbunov
1400bdc09a
Do not allow removeSurrounding remove overlapping prefix and suffix.
2015-11-04 22:19:59 +03:00
Ilya Gorbunov
05fd2b012a
Provide overloads both for Strings and CharSequences of filter, filterNot, reversed and partition
2015-11-04 22:19:57 +03:00
Ilya Gorbunov
62d6bcaa6d
Provide overloads both for Strings and CharSequences of removePrefix, removeSuffix, removeSurronding, trim* and pad*, replaceRange & removeRange
2015-11-04 22:19:55 +03:00
Ilya Gorbunov
8c16fad8b1
Make more string tests cross-platform.
2015-11-04 22:19:48 +03:00
Ilya Gorbunov
d021a324aa
Test CharSequence extension methods both for String and StringBuilder
2015-11-04 22:19:43 +03:00
Ilya Gorbunov
d1d865aa0f
Rename methods in Regex. Add matchEntire method to match entire string against regex.
2015-10-14 22:49:48 +03:00
Denis Zharkov
f0e3fd617d
Adjust testData to CharSequence.length transformation
2015-10-14 20:39:35 +03:00
Denis Zharkov
cb562e7ea5
Adjust JS backend to CharSequence.length transformation
2015-10-14 20:39:32 +03:00
Ilya Gorbunov
6d7cc0671e
Allow equals with ignoreCase parameter to take nullable Strings both as a receiver and a parameter.
...
#KT-9188
2015-10-14 18:19:56 +03:00
Ilya Gorbunov
404b228954
StdLib cleanup: replace fails with assertFails
2015-10-07 22:36:06 +03:00
Denis Zharkov
5cecaa6f87
Get rid of deprecated annotations and modifiers in stdlib (besides JS)
2015-09-18 10:14:28 +03:00
Ilya Gorbunov
ca798d8d71
Rename reverse to reversed.
...
#KT-8171
2015-08-27 11:45:30 +03:00
Sergey Mashkov
84ef068f5d
#KT-8708 refactor trimIndent, trimMargin, replaceIndent, replaceIndentByMargin, prependIndent
2015-08-12 18:45:10 +03:00
Sergey Mashkov
7afa40590d
KT-8708 Function to strip leading whitespace (stripMargin, trimMargin, stripIndent?)
2015-08-12 18:45:10 +03:00
Ilya Gorbunov
00a44f6d4f
StdLib deprecations cleanup: *array -> *arrayOf, copyToArray -> toTypedArray.
2015-06-29 17:05:57 +03:00
Ilya Gorbunov
d20d8e2106
2nd stage of replaceFirst semantics change: remove deprecated String.replaceFirst(String), rename replaceFirstLiteral to replaceFirst.
2015-06-24 21:48:09 +03:00
Ilya Gorbunov
249106647c
2nd stage of split semantics change: remove deprecated String.split(String), rename splitBy back to split. Provide replacement for splitBy and splitWithRegex (JS).
2015-06-24 21:48:07 +03:00
Ilya Gorbunov
6516c74a1a
Revert back 2nd stage of split semantics change and restore deprecated String.split(String).
2015-05-21 23:13:16 +03:00
Ilya Gorbunov
b1255cf95b
2nd stage of split semantics change: remove deprecated String.split(String), rename splitBy back to split.
2015-05-09 01:11:32 +03:00
Ilya Gorbunov
a5177b785d
Add String.replaceFirst methods.
...
String.replaceFirst(String, String) temporary named as replaceFirstLiteral.
2015-05-09 01:11:14 +03:00
Ilya Gorbunov
157c86b9c6
Empty string is supported as a delimiter in split and as an oldValue in replace.
2015-05-09 01:11:12 +03:00
Ilya Gorbunov
0b03caf3e7
Uniform implementation of String.replace and String.matches(Regex) across JVM and JS.
...
Deprecated String.matches(String) and String.replaceAll methods.
2015-05-09 01:11:03 +03:00