aboutsummaryrefslogtreecommitdiff
path: root/tests/core
Commit message (Collapse)AuthorAgeFilesLines
* Fix tests for UTF-16 stringsgingerBill2025-08-023-4/+5
|
* Remove unneeded uses of `intrinsics.constant_utf16_cstring`gingerBill2025-08-022-3/+3
|
* Fix #5498Jeroen van Rijn2025-07-252-105/+335
| | | | | | Also: - Expands `tests/core/hash` - Fixes bug found in `#hash(s, "murmur64")`
* Fix Linux-specific optimized test failureFeoramund2025-07-221-4/+9
| | | | | | | | The stack was not aligned as expected for `buddy_allocator_init` when `-o:speed` was enabled, making this a test failure that only appeared with optimizations enabled. The data is now aligned specifically, as it should be.
* Fix #5452Jeroen van Rijn2025-07-111-0/+33
|
* Remove altogether.Jeroen van Rijn2025-06-241-16/+1
|
* Disable two tests under core/sys/posix.Jeroen van Rijn2025-06-241-0/+10
|
* Fix issue parsing `vendor/stb/image` with the `core:odin/parser` parserBrad Lewis2025-06-221-0/+28
|
* Fix early join after start.Jeroen van Rijn2025-06-212-21/+21
|
* uncomment test, see if it's fixedLaytan Laats2025-06-201-3/+0
|
* Merge pull request #5329 from JackMordaunt/jfm-fix_chan_try_sendLaytan2025-06-201-47/+272
|\ | | | | chan: fix try_send and send
| * tests/core/sync/chan: test concurrent send/close/recvJack Mordaunt2025-06-131-0/+55
| | | | | | | | | | | | This test is designed to ensure that a call to send will always correctly report whether the value was transmitted. If recv wins, a close call should not be able to intercept the send thread.
| * core/sync/chan.send: return false if channel is closed while blockedJack Mordaunt2025-06-121-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | This commit makes send behave the same as recv: that the call will return false if the channel is closed while a thread is waiting on the blocking operation. Prior logic would have send return true even if the channel was actually closed rather than read from. Docs adjusted to make this clear. Tests added to lock in this behaviour.
| * tests/core/sync/chan: add test for contended try_sendJack Mordaunt2025-06-121-0/+149
| | | | | | | | | | | | This test ensures that contending threads racing to try_send against a single blocking read will result in exactly one winner without any senders blocking.
| * core/sync/chan.try_send: avoid blocking if no reader is availableJack Mordaunt2025-06-121-44/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the semantics of try_send to be consistently non-blocking. That is, if the buffered is full OR there are no readers it returns false. The previous behaviour was such that it would block in the latter case of no reader, and it would wait for a reader. That is problematic because it produces inconsistent behaviour between buffered and unbuffered channels which is astonishing and adds complexity to the caller. To illustrate the problem with the old behaviour, consider the try_select operation: if a send-channel happens to be unbuffered the try_select (which wants to never block) can now block, that unbuffered send channel is selected (at random) and there is no reader on the other side. Thus we have unpredictable blocking behaviour, which breaks the guarantee that try_select never blocks. If you want a blocking send you can just call "send" (the blocking variant). In addition, there is some reader/writer math done inside can_{send,recv} such that they only report true if there is sufficient reader/writer capacity. If there is contention we need to ensure that each reader is paired to exactly one writer. Consider try_send: if there is a single reader we can send. If there is a single reader and a single writer, then we cannot send, as that reader will be paired with the existing writer. Therefore can_send is only true if there are more readers than writers at the time of check. NOTE: The original tests don't need to use wait-looping with thread.yield() or heuristic sleep. Instead we can just use blocking channel operations rather than non-blocking operations.
| * test/core/sync/chan: serialize try_select testsJack Mordaunt2025-06-121-3/+7
| | | | | | | | | | | | These tests will race access to __global_context_for_test, which can cause the test suite to flake. Even though only a single test actually references the variable, the logic in try_select consumes it.
* | Merge pull request #5344 from Feoramund/fix-2694Jeroen van Rijn2025-06-191-0/+108
|\ \ | | | | | | Review `core/mem/allocators.odin`
| * | Add a tiny sanity test for `core:mem` allocatorsFeoramund2025-06-151-0/+108
| |/
* | Fix `WAVEFORMATEX` struct size (#5356)David Holland2025-06-182-2/+7
| | | | | | | | | | * fix WAVEFORMATEX struct size * fix size test for WAVEFORMATEX * pack WAVEFORMATEXTENSIBLE
* | Add tests for new test failure expectation APIFeoramund2025-06-161-0/+52
| |
* | Disable test_try_select_raw_happyJeroen van Rijn2025-06-161-0/+3
|/
* tests/core/sync/chan: move global state into testJack Mordaunt2025-06-121-2/+3
| | | | | While this state is not actually needed by more than one test, we can just make it a static variable.
* tests/core/sync/chan: test harness for chan.try_select_rawJack Mordaunt2025-06-121-0/+176
| | | | | | | | This test harness ensures consistent non-blocking semantics and validates that we have solved the toctou condition. The __global_context_for_test is a bit of a hack to fuse together the test supplied proc and the executing logic in packaage chan.
* container/queue: Add testsFeoramund2025-06-111-0/+157
|
* Delete duplicate test vectors.Jeroen van Rijn2025-06-111-4813/+0
|
* Turn `core:math/bìg` tests into regular `core:testing` tests.Jeroen van Rijn2025-06-117-1154/+10459
| | | | | | `core:math/big` has been verified against Python's big integer implementation long enough. Turn it into a regular regression test using the `core:testing` framework, testing against a generated corpus of test vectors.
* Fix pathJeroen van Rijn2025-06-101-1/+1
|
* Add initial tests for big rationalsJeroen van Rijn2025-06-102-1/+51
|
* flags: Rename `varg` to `overflow`, let it be renamed with configFeoramund2025-06-091-45/+45
|
* Add more `core:flags` tests to codify behaviorFeoramund2025-06-091-0/+104
|
* flags: Rename `variadic` to `manifold` (breaking change)Feoramund2025-06-091-10/+10
|
* Clarify `strconv.append_*` to `strconv.write_*`Feoramund2025-06-051-1/+1
|
* encoding/cbor: support simd vectorsLaytan Laats2025-06-041-0/+8
|
* encoding/cbor: support the matrix typeLaytan Laats2025-06-041-0/+20
|
* Vectorize `strings.prefix_length`.Jeroen van Rijn2025-05-311-1/+50
| | | | Also add `strings.common_prefix`.
* Add tests for `runtime.memory_*` comparison proceduresFeoramund2025-05-291-0/+76
|
* Fix multiline RegEx iterationFeoramund2025-05-261-3/+54
| | | | | | | | | | In `.Multiline` mode: - `^` is now defined to assert the start of the string or that a "\n" or "\r" rune was parsed on last VM dispatch. - `$` is now defined to consume a newline sequence of "\n", "\r", or "\r\n" or to assert the end of the string.
* Add more RegEx testsFeoramund2025-05-241-6/+160
|
* Remove `Global` RegEx flag, default to unanchored patternsFeoramund2025-05-241-12/+12
|
* Make RegEx VM restartable and fix iterator infinite loopFeoramund2025-05-241-2/+3
|
* Fix os2.clean_path on WindowsJeroen van Rijn2025-05-112-37/+49
|
* add hexfloat (0h) parsing to strconvLaytan Laats2025-05-101-0/+37
|
* Fix parsing of CDATA tags (#5059)Jeroen van Rijn2025-04-192-6/+11
| | | Fixes #5054
* `signbit` -> `sign_bit` in `tests/core/math`Jeroen van Rijn2025-04-151-1/+1
|
* `core:mem/tlsf`: Add early-out in OOM logicJeroen van Rijn2025-04-141-5/+2
| | | | | | | | This implementation doesn't allow for out-of-band allocations to be passed through, as it's not designed to track those. Nor is it able to signal those allocations then need to be freed on the backing allocator, as opposed to regular allocations handled for you when you `destroy` the TLSF instance. So if we're asked for more than we're configured to grow by, we can fail with an OOM error early, without adding a new pool.
* Allow `core:mem/tlsf` to automatically add new pools.Jeroen van Rijn2025-04-141-1/+41
| | | | | | | New features: - If TLSF can't service an allocation made on it, and it's initialized with `new_pool_size` > 0, it will ask the backing allocator for additional memory. - `estimate_pool_size` can tell you what size your initial (and `new_pool_size`) ought to be if you want to make `count` allocations of `size` and `alignment`, or in its other form, how much backing memory is needed for `count` allocations of `type` and its corresponding size and alignment.
* Refactor `core:mem/tlsf`, add `free_all` support.Jeroen van Rijn2025-04-141-0/+102
| | | | | TODO: Allow the TLSF allocator to add additional pools when it would ordinarily OOM by calling its backing allocator.
* Add tests for `type_elem_type` on SIMD vectorsJeroen van Rijn2025-04-111-0/+71
|
* Added tests for `math.nextafter`.Barinzaya2025-04-071-0/+189
|
* Optimize regex match iterator.Jeroen van Rijn2025-04-071-2/+1
| | | | Reuse virtual machine and capture groups between matches.