about summary refs log tree commit diff
path: root/library/std/tests
AgeCommit message (Collapse)AuthorLines
2025-06-03Enable Float non-determinism in miri. Update and add tests and changeLorrensP-2158466-18/+63
change tests in std, core and coretests.
2025-05-25Implement normalize lexicallyChris Denton-1/+55
2025-05-24Rollup merge of #141105 - GrantBirki:grantbirki/path-tests, r=jhprattGuillaume Gomez-0/+31
additional edge cases tests for `path.rs` 🧪 This pull request adds a few new edge case tests to the `std::path` module. The new tests cover scenarios such as paths with only separators, non-ASCII and Unicode characters, embedded new lines, etc. Each new test is documented with some helpful in-line comments as well.
2025-05-17remove extra tests that really might not be all that usefulGrantBirki-55/+0
2025-05-17revert forward slash to backslashGrantBirki-1/+1
2025-05-16remove `test_embedded_null_byte()` test for nowGrantBirki-20/+0
2025-05-16additional edge cases tests for `path.rs`GrantBirki-1/+107
2025-05-14Move applicable float tests from `coretests` back to `std`Trevor Gross-0/+1166
The previous commit moved all test files from `std` to `core` so git understands the move. Not all functionality is actually testable in `core`, however, so perform move the relevant portions back. Changes from inherent to module methods is also done since this is the form of math operations available in `core` (as `core_float_math`).
2025-05-13Move float tests from std to coreTrevor Gross-3994/+0
Many float-related tests in `std` only depend on `core`, so move the tests there. This also allows us to verify functions from `core_float_math`. Since the majority of test files need to be moved to `coretests`, move the files here without any cleanup; this is done in a followup commit. This makes git history slightly cleaner, but coretests will not build immediately after this commit.
2025-05-12update cfg(bootstrap)Pietro Albini-64/+2
2025-04-30Rename `(Mapped)(RwLock|Mutex)Guard::try_map` to `filter_map`.Zachary S-18/+26
1. analogous to std::cell::Ref(Mut)::filter_map. 2. doesn't imply `Try` genericizability.
2025-04-27Use `feature(target_has_reliable_f16_f128)` in library testsTrevor Gross-62/+192
New compiler configuration has been introduced that is designed to replace the build script configuration `reliable_f16`, `reliable_f128`, `reliable_f16_math`, and `reliable_f128_math`. Do this replacement here, which allows us to clean up `std`'s build script. All tests are gated by `#[cfg(bootstrap)]` rather than doing a more complicated `cfg(bootstrap)` / `cfg(not(bootstrap))` split since the next beta split is within two weeks.
2025-04-22test_nan: ensure the NAN contant is quietRalf Jung-0/+8
2025-04-15Basic tests of MPMC receiver cloningGlyn Normington-0/+30
Ref: https://github.com/rust-lang/rust/issues/126840#issuecomment-2802321146
2025-04-05Rollup merge of #137897 - xTachyon:tls-fix, r=thomcc,jieyouxuStuart Cook-1/+22
fix pthread-based tls on apple targets Tries to fix #127773.
2025-04-04Expose algebraic floating point intrinsicsCalder Coalson-2/+82
2025-03-22Rollup merge of #138294 - paulmenage:test-panic-unwind, r=bjorn3Matthias Krüger-2/+34
Mark some std tests as requiring `panic = "unwind"` This allows these test modules to pass on builds/targets without unwinding support, where `panic = "abort"` - the ignored tests are for functionality that's not supported on those targets.
2025-03-18fix pthread-based tls on apple targetsAndrei Damian-1/+22
2025-03-17Rollup merge of #137793 - NobodyXu:stablise-annoymous-pipe, r=joshtriplettJacob Pratt-2/+0
Stablize anonymous pipe Since #135822 is staled, I create this PR to stablise anonymous pipe Closes #127154 try-job: test-various
2025-03-17Auto merge of #138363 - beetrees:f16-f128-integer-convert, r=Amanieubors-0/+43
Add `From<{integer}>` for `f16`/`f128` impls This PR adds `impl From<{bool,i8,u8}> for f16` and `impl From<{bool,i8,u8,i16,u16,i32,u32}> for f128`. The `From<{i64,u64}> for f128` impls are left commented out as adding them would allow using `f128` on stable before it is stabilised like in the following example: ```rust fn f<T: From<u64>>(x: T) -> T { x } fn main() { let x = f(1.0); // the type of the literal is inferred to be `f128` } ``` None of the impls added in this PR have this issue as they are all, at minimum, also implemented by `f64`. This PR will need a crater run for the `From<{i32,u32}>` impls, as `f64` is no longer the only float type to implement them (similar to the cause of #125198). cc `@bjoernager` r? `@tgross35` Tracking issue: #116909
2025-03-16Rollup merge of #138275 - folkertdev:expose-is-s390x-feature-detected, ↵许杰友 Jieyou Xu (Joe)-0/+30
r=Mark-Simulacrum expose `is_s390x_feature_detected!` from `std::arch` tracking issue: https://github.com/rust-lang/rust/issues/135413 implementation: https://github.com/rust-lang/stdarch/pull/1699 (more features added in https://github.com/rust-lang/stdarch/pull/1720) This macro was part of the recent `stdarch` synchronization, but not yet exposed via `std::arch`. r? libs
2025-03-14Stablize feature `anonymous_pipe`Jiahao XU-2/+0
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2025-03-11Add `From<{integer}>` for `f16`/`f128` implsbeetrees-0/+43
2025-03-11Enable `f16` tests for `powf`Trevor Gross-43/+41
The LLVM issue [1] was fixed with [2], which is included in the LLVM20 upgrade. Tests no longer fail, so enable them here. [1]: https://github.com/llvm/llvm-project/pull/98681 [2]: https://github.com/llvm/llvm-project/pull/98681
2025-03-10Mark some std tests as requiring `panic = "unwind"`Paul Menage-2/+34
This allows these test modules to pass on builds/targets without unwinding support, where `panic = "abort"` - the ignored tests are for functionality that's not supported on those targets.
2025-03-09expose `is_s390x_feature_detected` from `std::arch`Folkert de Vries-0/+30
2025-02-13std: Apply deprecated_safe_2024Eric Huss-33/+51
2025-02-13library: Update rand to 0.9.0Eric Huss-2/+2
2025-02-10Rollup merge of #136805 - RalfJung:miri-win-delete-self, r=NoratriebJubilee-0/+1
ignore win_delete_self test in Miri Follow-up to https://github.com/rust-lang/rust/pull/134679, fixes miri-test-libstd on Windows Cc `@ChrisDenton` `@Mark-Simulacrum`
2025-02-10ignore win_delete_self test in MiriRalf Jung-0/+1
2025-02-09Mark extern blocks as unsafeMichael Goulet-2/+2
2025-02-09Auto merge of #136754 - Urgau:rollup-qlkhjqr, r=Urgaubors-0/+8
Rollup of 5 pull requests Successful merges: - #134679 (Windows: remove readonly files) - #136213 (Allow Rust to use a number of libc filesystem calls) - #136530 (Implement `x perf` directly in bootstrap) - #136601 (Detect (non-raw) borrows of null ZST pointers in CheckNull) - #136659 (Pick the max DWARF version when LTO'ing modules with different versions ) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-09Rollup merge of #134679 - ChrisDenton:rm-readonly, r=Mark-SimulacrumUrgau-0/+8
Windows: remove readonly files When calling `remove_file`, we shouldn't fail to delete readonly files. As the test makes clear, this make the Windows behaviour consistent with other platforms. This also makes us internally consistent with `remove_dir_all`. try-job: x86_64-msvc-ext1
2025-02-08Rollup merge of #135696 - joboet:move_pal_io, r=NoratriebMatthias Krüger-1/+1
std: move `io` module out of `pal`, get rid of `sys_common::io` Part of #117276. This does two related things: 1. It moves the platform-specific definitions for `IoSlice`, `IoSliceMut` and `is_terminal` out of `pal` and into `sys` and unifies some of them. 2. It gets rid of `sys_common::io`, moving the non-platform-specific test helpers into `std::test_helpers` and the buffer size definition to the new `sys::io` module.
2025-02-07std: get rid of `sys_common::io`joboet-1/+1
2025-02-06Remove some unnecessary parens in `assert!` conditionsEsteban Küber-13/+13
While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter.
2025-02-02Remove stabilized feature gatebjorn3-2/+1
2025-01-26Move env modifying tests to a separate integration testbjorn3-160/+166
2025-01-26Fix for SGXbjorn3-1/+1
2025-01-26Move std::sync unit tests to integration testsbjorn3-0/+4120
This removes two minor OnceLock tests which test private methods. The rest of the tests should be more than enough to catch mistakes in those private methods. Also makes ReentrantLock::try_lock public. And finally it makes the mpmc tests actually run.
2025-01-26Move std::thread_local unit tests to integration testsbjorn3-0/+420
2025-01-26Move std::time unit tests to integration testsbjorn3-0/+229
2025-01-26Move std::path unit tests to integration testsbjorn3-0/+1978
2025-01-26Move std::panic unit tests to integration testsbjorn3-0/+56
2025-01-26Move std::num unit tests to integration testsbjorn3-0/+230
2025-01-26Move std float unit tests to integration testsbjorn3-0/+3797
2025-01-26Move std::error unit tests to integration testsbjorn3-0/+442
2025-01-26Move std::env unit tests to integration testsbjorn3-0/+120
2025-01-26Windows: Test that deleting a running binary failsChris Denton-0/+8
2025-01-24Fix testing of the standard library with Emscriptenbjorn3-2/+3
This does need EMCC_CFLAGS="-s MAXIMUM_MEMORY=2GB" avoid several OOMs.