Commit Graph

82 Commits

Author SHA1 Message Date
Marek Langiewicz 934b0b8c38 Fix List.takeLast for lists without RandomAccess 2017-05-03 16:38:15 +02:00
Ilya Gorbunov 6ae19e03d5 Clean warnings and refactor stdlib tests.
Merge RangeJVMTest into RangeTest.
2017-04-18 18:51:20 +03:00
Ilya Gorbunov 01f53d0173 Return NaN as an average of an empty collection.
#KT-15399 Fixed
2017-01-27 14:53:33 +03:00
Ilya Gorbunov 80f2efb625 joinTo/joinToString: Do not call toString on elements that are already CharSequence or Char.
#KT-15557
2017-01-13 19:49:57 +03:00
Ilya Gorbunov cdfb72ab76 Provide protected toArray implementation in AbstractCollection.
Relates to #KT-13898
2017-01-13 19:38:28 +03:00
Ilya Gorbunov 5db75c993b Introduce array-like list instantiation functions.
#KT-14935 Fixed
2016-12-30 20:00:45 +03:00
Ilya Gorbunov 6a70761783 Minor: normalize '@Test' annotation casing in all tests. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov 50cd620f92 Remove java.util.* imports from common code. 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 c5a208f3eb Rearrange stdlib unit tests across packages.
Rearrange JS stdlib unit tests.
2016-06-18 16:50:32 +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 409094f0f7 Make stdlib functions dependent on reified is checks available in JS.
#KT-11346 Fixed
2016-04-27 18:22:20 +03:00
Ilya Gorbunov ab68b49a70 Introduce RandomAccess to JS.
Make EmptyList support RandomAccess.
#KT-10794
2016-03-30 21:06:18 +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
Ilya Gorbunov 1357c77d0b Minor: verify exception type of failed fold/reduce 2016-01-31 02:45:04 +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 8d02467e6d Introduce plusElement and minusElement to disambiguate situations like List<List<T>> + List<T>
#KT-9992 Fixed
2016-01-27 00:00:01 +03:00
Ilya Gorbunov 7703252239 Provide groupBy and groupByTo with keySelector and valueTransform.
Rename parameters of groupBy, add type parameter for MutableMap to groupByTo.
2016-01-25 21:15:56 +03:00
Ilya Gorbunov 67ef790abc Move comparison related functions to kotlin.comparisons, update imports in stdlib. 2016-01-18 21:46:31 +03:00
Ilya Gorbunov 055c71e8d0 Provide minWith and maxWith to find maximum and minimum values according to the given comparator.
#KT-9002 Fixed
2015-12-18 00:00:52 +03:00
Ilya Gorbunov c7d08ea599 Remove *Raw method usages from tests 2015-11-28 07:20:25 +03:00
Ilya Gorbunov 794819cea2 StdLib cleanup: make calls non-infix 2015-11-21 00:54:10 +03:00
Ilya Gorbunov 838109c302 StdLib cleanup, deprecated symbol usage: replace end with endInclusive 2015-11-21 00:54:06 +03:00
Ilya Gorbunov 07654eb82b StdLib cleanup, deprecated symbol usage: size() and length() 2015-11-21 00:54:05 +03:00
Ilya Gorbunov 1a0c2e2cf6 In-place sorting.
#KT-9034
2015-11-05 09:04:31 +03:00
Ilya Gorbunov 5e9b7b9e60 Collections.sort without comparator now uses natural order.
#KT-9771 Fixed
2015-11-05 09:03:30 +03:00
Ilya Gorbunov 4fc54a12b8 In-place reversing.
#KT-9034
2015-11-05 09:02:58 +03:00
Ilya Gorbunov 65a98d6968 Temporary drop mapNotNull and mapNotNullTo.
Disable mapNotNull tests

#KT-4410
2015-11-04 00:05:45 +03:00
Ilya Gorbunov 579ce8091c Cleanup tests, specify type where it's ambiguous. 2015-10-27 21:48:27 +03:00
Alexey Tsvetkov eae644c365 Remove isArrayOf reference from common JVM/JS test 2015-10-14 20:06:52 +03:00
Alexey Tsvetkov 62c25c0370 Replace is Array<T> with .isArrayOf<T>() 2015-10-14 18:36:53 +03:00
Ilya Gorbunov db93532e7c Deprecate merge and introduce instead zip with transform.
Add zip with transform for Strings.
2015-10-08 17:48:35 +03:00
Ilya Gorbunov 12d9beb3a4 Deprecate join (use joinToString instead)
#KT-6909
2015-10-08 17:48:33 +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 84d3d42e05 Replace deprecated reverse method usages. 2015-08-27 11:45:44 +03:00
Ilya Gorbunov ca798d8d71 Rename reverse to reversed.
#KT-8171
2015-08-27 11:45:30 +03:00
Ilya Gorbunov b8badd59ba Introduce reversed extension for Comparator. 2015-08-27 00:10:11 +03:00
Ilya Gorbunov 7d33599fc2 Parameterless nullsFirst and nullsLast and misc comparator combining functions. 2015-08-27 00:09:44 +03:00
Ilya Gorbunov 5a4e598ba7 Another approach for sorting nulls. 2015-08-27 00:09:31 +03:00
Ilya Gorbunov d49a1973e5 Change null handling in compareValuesBy(a, b, functions). Provide nullsFirst() and nullsLast() to extend Comparator<T> to Comparator<T?>. 2015-08-27 00:09:17 +03:00
Ilya Gorbunov 63110dcdf8 Remove StdLibArraysTest and include collections/ArraysTest.kt into StdLibTestToJSTest smoke tests instead.
Move helper methods, so they are available in JS semantics tests.
2015-08-27 00:09:04 +03:00
Ilya Gorbunov 521e0b679d Rename sortedDescendingBy to sortedByDescending 2015-08-27 00:08:50 +03:00
Ilya Gorbunov 002c3e850f Tests for sorting methods. 2015-08-27 00:08:37 +03:00
Sergey Mashkov 0e25a5ea82 JS: arrayToString should use toString() instead of direct join to handle nulls properly
#KT-8663 Fixed
2015-07-31 14:28:30 +03:00
Ilya Gorbunov d831509cee Provide listOfNotNull method. 2015-07-24 04:34:31 +03:00
Ilya Gorbunov da3ec891d0 Provide unzip method for Iterables, Arrays and Sequences of pairs.
#KT-5793 Fixed
2015-07-24 04:28:57 +03:00
Ilya Gorbunov 690a536734 Tests for minus operation for collections, sets, iterables and sequences. 2015-07-17 10:53:31 +03:00
Ilya Gorbunov 048a3ebcc1 Implement plus for sequence as operand and refactor plus tests. 2015-07-17 10:53:05 +03:00