Commit Graph

54 Commits

Author SHA1 Message Date
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
Stanislav Erokhin b703f59e04 Migrate kotlin sources, maven projects and stdlib to new lambda syntax 2015-04-07 13:08:53 +03:00
Ilya Gorbunov 7cac6e3c5e Provide String.commonPrefixWith and String.commonSuffixWith methods.
Char.isHighSurrogate and Char.isLowSurrogate now available in js-stdlib too.
2015-04-07 03:15:03 +03:00
Ilya Gorbunov 91decc9f33 Add String.contains with Char argument. Fixes #KT-7239. 2015-04-07 03:14:36 +03:00
Ilya Gorbunov cac058d5a3 Fix endsWith in JS always ignored character case, regardless of the ignoreCase parameter value.
startsWith, endsWith again use native implementation when possible.
2015-04-01 23:10:14 +03:00
Ilya Gorbunov ac4b207413 Add isEmpty, isBlank methods and their nullable and negating couterparts. 2015-04-01 15:40:17 +03:00
Ilya Gorbunov 536a977f5c indexOfAny, lastIndexOfAny return an index value only (similar to indexOf, lastIndexOf).
findAnyOf, findLastAnyOf introduced to cover the case when an index and a matched string value is required.
2015-03-31 02:25:19 +03:00
Ilya Gorbunov b3165ac771 Rename split method to splitBy and revive old split implementation interpreting parameter as regex to provide the migration path. 2015-03-31 02:24:50 +03:00
Ilya Gorbunov 6f7a4d8429 Add methods for String: indexOfAny, lastIndexOfAny, indexOf, lastIndexOf, rangesDelimitedBy, splitToSequence, split, lineSequence, lines.
Add methods for Char: toUpperCase, toLowerCase.
Add an optional boolean parameter ignoreCase to the methods Char.equals, String.equals, String.startsWith, String.endsWith, String.contains.
2015-03-31 02:23:52 +03:00
Ilya Gorbunov a34e15e157 Rename methods: trimLeft/Right -> trimStart/End, padLeft/Right -> padStart/End 2015-03-25 03:26:31 +03:00
Ilya Gorbunov 05b5afcb94 Add removePrefix, removeSuffix, removeEnclosing methods.
Deprecate trimLeading/trimTrailing/trim(String) methods in favor of new ones.
2015-03-25 03:25:53 +03:00
Ilya Gorbunov 5b2a5c78ca Fix js-stdlib compilation and tests. 2015-03-25 03:25:27 +03:00
Ilya Gorbunov 4c58f4ec20 Add removeRange method.
Breaking change in replaceRange(IntRange, String) method: the end index of the range now is included in the part being replaced.
2015-03-25 03:25:14 +03:00
Ilya Gorbunov ba15e5b295 Trimming and padding methods.
Kinda breaking change: Char.isWhitespace treats non-breaking spaces as whitespace too to match the Unicode definition of whitespace.
2015-03-25 03:25:01 +03:00
Zalim Bashorov eae86e035f Minor in stdlib: move String.trimLeading and String.trimTrailing to common place. 2014-11-18 15:57:50 +03:00
Zalim Bashorov 624f5c4c34 Minor: moved test for check the iterating over String to common place.
#KT-3617 Fixed
2014-11-07 16:30:50 +03:00
Ilya Ryzhenkov 295ce5fdf8 Unify substringBefore/After and related functions, so that they always return receiver in case of missing delimiter by default. 2014-07-16 21:10:32 +04:00
Ilya Ryzhenkov 516bae17d7 StringBuilder builder and appendln 2014-06-24 23:49:15 +04:00