Commit Graph

102 Commits

Author SHA1 Message Date
Vsevolod Tolstopyatov 175cf5e833 KT-53327 replace Enum.values() with Enum.entries in CharCategory
Also, replace it in stdlib tests where appropriate and disable already unsupported legacy JS tests


^KT-53327 fixed

Co-authored-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>

Merge-request: KT-MR-10632
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-06-21 14:40:16 +00:00
Ilya Gorbunov bbb36ce501 KT-58046 Promote time sources, time marks, measureTime to stable 2023-05-16 11:42:32 +00:00
Alexander Udalov 98fb4f1f45 Stdlib tests: annotate serialized lambdas explicitly
Behavior is going to change in KT-45375 and lambdas will no longer be
serializable by default.
2023-05-12 19:55:25 +00:00
Abduqodiri Qurbonzoda 2248f4ea33 Remove supportsNamedCapturingGroup flag in tests
Now it is true on all platforms
2023-04-26 10:44:21 +00:00
Ilya Gorbunov ace2279631 Refactor helper function to run/not run block of common code on specific platform
Use it in StringBuilder tests
2023-04-25 13:55:04 +00:00
Filipp Zhinkin 50841e7cb0 KT-42589 Add listOf, setOf, mapOf overloads for a single value to common src-set
`listOf`, `setOf` and `mapOf` overloads were defined in some source-sets
but common source-set was missing it.
This change adds common definition of these methods and also add
declarations for source-sets that were previously
missing it.

^KT-42589 fixed
2023-04-20 08:42:15 +00:00
Ilya Gorbunov 1014434475 KT-58046 Use saturated math in LongTimeMark implementation
- keep offset in range (-1..+1) of time source units
- when adding big or infinite offset, saturate startedAt instead
- displace initial reading to zero, similar to MonotonicTimeSource
- fix the zero reading in TestTimeSource by calling markNow in constructor
- use more precise reading adjustment in TestTimeSource for big durations
- add a note about comparable time marks for AbstractLongTimeSource and TestTimeSource
2023-04-18 15:25:31 +00:00
Nikita Bobko f620eb920f Drop redundant suppress
Review: https://jetbrains.team/p/kt/reviews/8933

The suppress was needed in https://jetbrains.team/p/kt/reviews/8308

But it's not needed anymore
2023-02-24 17:05:33 +00:00
Nikita Bobko 9a865e4c55 [FE 1.0] Issue a warning if expect and actual are declared in the same module
The commit is based on b09561c3c3
Co-authored-by: Dmitriy Novozhilov <dmitriy.novozhilov@jetbrains.com>

^KT-40904 Fixed
^KT-55177 Fixed
Review: https://jetbrains.team/p/kt/reviews/8731

True negative test already exist:
`compiler/testData/diagnostics/tests/multiplatform/hmpp/multiplatformCompositeAnalysis/intermediateWithActualAndExpect.kt`
2023-02-21 14:45:46 +01:00
Ilya Gorbunov 5a4eb22961 Move isolated addSuppressed extension test to jvm tests
Conditions for being isolated do not hold anymore:
it tested that addSuppressed extension could work without kotlin-stdlib-jdk7,
but now the latter is merged to kotlin-stdlib and thus always present

#KT-51907
2023-01-26 20:57:00 +00:00
Dmitriy Novozhilov 8d728d4f53 Revert "[FE 1.0] Deprecate declaration of expect and actual in the same module"
This reverts commit b09561c3c3.

It was decided to postpone this warning till 1.9
This is needed to provide proper IDE support

^KT-40904 Open
^KT-55177 Open
2023-01-17 18:02:50 +00:00
Dmitriy Novozhilov b09561c3c3 [FE 1.0] Deprecate declaration of expect and actual in the same module
^KT-40904 Fixed
^KT-55177 Fixed
2023-01-17 09:43:14 +00:00
Abduqodiri Qurbonzoda dc03a03762 Introduce basic, url-safe and mime Base64 variants #KT-9823 2023-01-16 11:24:49 +00:00
Abduqodiri Qurbonzoda 71381ec8e2 [K/N] HashMap/HashSet doesn't reclaim storage after removing elements #KT-53310 2022-10-07 11:19:31 +00:00
Ilya Gorbunov b53a6beb61 Loosen the signature of declaringJavaClass to accept Enum<E> instead of E
KT-54005
2022-09-14 13:39:25 +00:00
Abduqodiri Qurbonzoda 0db9326105 Introduce a deprecated StringBuilder.append(CharArray, Int, Int) in Common #KT-52336 2022-09-08 14:34:38 +00:00
Vsevolod Tolstopyatov 5054e301be [stdlib] Improve EnumEntries
* Provide short-circuit methods for contract "EnumEntries contains all
  enum entries"
* Make EnumEntries serializable
* Introduce more convenient overload for other backends

#KT-53152


Merge-request: KT-MR-6867
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2022-08-22 16:50:28 +00:00
Abduqodiri Qurbonzoda 6c4777dcdd Fix JDK-dependent stdlib tests after advancing jvmTarget 2022-08-17 22:55:43 +03:00
Ilya Gorbunov e5902e736d Account for potential delay inaccuracy in test
Sleep for slightly longer duration since the thread can be waked
a bit earlier than the specified amount of time.
2022-07-19 20:57:39 +00:00
Ilya Gorbunov 77cf41c189 Saturate overflowing values when adjusting time marks
KT-46132
2022-04-14 16:54:31 +00:00
Abduqodiri Qurbonzoda 33fb49f20d Fix JDK7 failing tests 2022-04-06 07:42:58 +00:00
Abduqodiri Qurbonzoda 1cb5cab28f [K/N and WASM] Fix ESCAPE and COMMENTS modes 2022-04-05 15:21:31 +00:00
Abduqodiri Qurbonzoda 187faa121e Test backreference to group with index zero 2022-04-05 15:21:29 +00:00
Abduqodiri Qurbonzoda 74121b26c0 Test octal literal in regex 2022-04-05 15:21:28 +00:00
Abduqodiri Qurbonzoda 46408ffd9d Fix tests by adjusting to platform behavior 2022-04-05 15:21:27 +00:00
Vsevolod Tolstopyatov 82c959c4be KT-51082 introduce Class<E : Enum<E>>.declaringJavaClass as a future replacement for synthetic declaringClass 2022-04-04 13:36:14 +00:00
Ilya Gorbunov 4386a800c8 KT-49721 Avoid matching from the same position after a zero-width match
In JS, RegExp can return a match before the specified start index,
if it has matched at that index, but it is in the middle of a surrogate
pair. Account for that when advancing to the next position after
a zero-width match so that it doesn't get to the middle of SP.
2021-11-29 17:02:06 +00:00
Abduqodiri Qurbonzoda dc2f5eab25 Align JS and JVM behavior of Regex replace function #KT-28378 2021-09-30 17:38:03 +00:00
Abduqodiri Qurbonzoda cca5f82aa0 Handle container builders capacity overflow 2021-09-30 16:01:57 +00:00
Ilya Gorbunov 04d70162d2 Make DurationUnit not a typealias of TimeUnit on JVM
Provide conversion functions between DurationUnit and TimeUnit
2021-09-30 14:31:54 +00:00
Abduqodiri Qurbonzoda 97eb28144f Introduce Common readln() and readlnOrNull() top-level functions #KT-48456 2021-09-05 15:31:11 +00:00
Ilya Gorbunov 43a614ffcd Make builder collection implementations serializable KT-39328
Collections returned by collection builders are now serializable in
their read-only state.
The builder mutable collections inside collection builder lambda,
however, are not.
2021-08-24 23:13:57 +00:00
Alexander Udalov 3bc0eaff59 Fix warnings in stdlib samples and test modules 2021-08-10 17:57:50 +02:00
Abduqodiri Qurbonzoda aa543c6631 Migrate stdlib, tests and samples to new case conversion api 2021-04-08 03:22:01 +03:00
Ilya Gorbunov b64b96eee6 Deprecate Char-to-Number conversions in stdlib (JVM and JS)
- Int.toChar was left non-deprecated because the replacement is not intrinsic yet.
- Number.toChar was left non-deprecated because otherwise the deprecation propagates to the override, Int.toChar.

KT-23451
2021-04-07 18:30:20 +03:00
Ilya Gorbunov 256f634e61 Support all digit chars in digitToInt on JVM KT-23451 2021-04-03 10:30:50 +03:00
Abduqodiri Qurbonzoda 421cb6971d Optimized toArray method for ArrayDeque and ListBuilder #KT-42720 2021-03-06 11:14:50 +03:00
Ilya Gorbunov ca6ce151a2 Unify test package names in kotlin-stdlib tests
This makes 'test.' an implicit package prefix, thus fixing the inspection
"Package directive doesn't match file location" positive in almost all
test files.
2021-02-25 09:58:14 +03:00
Dmitriy Novozhilov bc3b791cd8 [TMP] Remove :kotlin-coroutines-experimental-compat module 2021-01-28 13:19:34 +03:00
Ilya Gorbunov 79e426270c Rename Random.Default serialization surrogate object (KT-25571) 2020-12-31 06:57:17 +03:00
Iaroslav Postovalov 00506a75d3 Make Random implementations serializable (KT-25571)
Make Random.Default, XorWowRandom, and wrapper classes for JDK Random implement Serializable interface.

Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2020-12-31 04:10:28 +03:00
Abduqodiri Qurbonzoda 1314adb6f7 Locale-agnostic case conversions by default #KT-43023 2020-12-30 10:08:25 +03:00
Ilya Gorbunov 66f5c98505 Deprecate createTempFile/createTempDir functions
Document their potential permission problems.
Suppress this deprecation in tests.
2020-11-10 18:25:48 +03:00
Valeriy.Vyrva 30ff886754 Improve docs for createTempDir/createTempFile
#KT-35218
2020-08-10 17:29:25 +03:00
Ilya Gorbunov 2f3e1dcbc6 Add EXACTLY_ONCE contract to suspendCoroutine* functions
Update line numbers in the affected test.
2020-07-10 01:05:16 +03:00
Ilya Gorbunov 33150a0809 KT-38817 capitalize uses title case for the first char where available
This unifies its behavior with new capitalize overload with Locale.

Co-authored-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2020-06-24 16:45:09 +03:00
Ilya Gorbunov e13a38a758 Fix OnlyInputType usage in tests where it can be invisible 2020-06-18 09:34:13 +03:00
Alexander Udalov 650469024e Fix expected FQ name in JavaTypeTest.nestedTypes 2020-06-17 19:47:45 +02:00
Ilya Gorbunov 41131e46d7 Shadow addSuppressed member with an extension
#KT-38777
2020-06-17 19:45:15 +03:00
Alexander Udalov 9e37b62f62 Support KType.javaType in stdlib
#KT-32241 Fixed
2020-06-17 18:33:08 +02:00