aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add to `tests/internal`Jeroen van Rijn2025-06-261-0/+34
| | | | Turn repro code into a proper test, and delete superfluous files from Odin root.
* 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.
* | Add test for issue #3435Feoramund2025-06-193-0/+40
| |
* | Merge pull request #5344 from Feoramund/fix-2694Jeroen van Rijn2025-06-194-0/+152
|\ \ | | | | | | Review `core/mem/allocators.odin`
| * | Add a tiny sanity test for `core:mem` allocatorsFeoramund2025-06-151-0/+108
| | |
| * | Add test for issue #2694Feoramund2025-06-153-0/+44
| |/
* | 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
|
* Let compound literal array be broadcast to a struct field of arraysFeoramund2025-06-053-0/+20
| | | | | | Fixes #4364 Patch courtesy of @cribalik
* encoding/cbor: support simd vectorsLaytan Laats2025-06-041-0/+8
|
* encoding/cbor: support the matrix typeLaytan Laats2025-06-041-0/+20
|
* Fix #5265Jeroen van Rijn2025-06-033-0/+10
|
* fix swizzle in for in statementLaytan Laats2025-06-023-0/+23
| | | | Fixes #1730
* -vetJeroen van Rijn2025-05-311-1/+0
|
* Vectorize `strings.prefix_length`.Jeroen van Rijn2025-05-313-1/+183
| | | | Also add `strings.common_prefix`.
* Use `time.Stopwatch` in `core:bytes` benchmarkFeoramund2025-05-291-4/+5
| | | | | | This should result in a clearer idea of how fast the procedures are running, as the loop can run without going back and forth to the system for the time.
* Add benchmarks for `runtime.memory_*` comparison proceduresFeoramund2025-05-291-0/+227
|
* 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.
* fix another type alias issue with mini cycleLaytan Laats2025-05-263-0/+26
|
* Add more RegEx testsFeoramund2025-05-241-6/+160
|
* Remove `Global` RegEx flag, default to unanchored patternsFeoramund2025-05-242-16/+18
|
* Make RegEx VM restartable and fix iterator infinite loopFeoramund2025-05-241-2/+3
|
* fix global and static anyLaytan Laats2025-05-171-0/+40
| | | | Fixes #4627
* new compiler intrinsics type_integer_to_unsigned,type_integer_to_signed0xrsp2025-05-151-0/+34
|
* Fix os2.clean_path on WindowsJeroen van Rijn2025-05-112-37/+49
|
* add hexfloat (0h) parsing to strconvLaytan Laats2025-05-101-0/+37
|
* Merge pull request #5098 from laytan/fix-nan-comparisonsgingerBill2025-05-021-0/+44
|\ | | | | fix variable NaN comparisons