-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Unhelpful error when assertion fails due to different data type #10549
Copy link
Copy link
Closed
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemA:std-libraryDefining and improving the standard library written in NuDefining and improving the standard library written in Nutestsissues to add tests or fix testsissues to add tests or fix tests
Milestone
Description
Describe the bug
When assert fails due to the data types of some recoords being different but the string representation are equivalent the assertion error is quite unhelpful isnce it shows the same string. This one had me tear my hair out for quite a while
How to reproduce
use std assert
assert equal {one:1 two:2} {one:"1" two:"2"}Expected behavior
The error should incorporate at least some information about the datatype or make an effort to differentiate the string representation. Ideally it would point out that the record fields have incompatible types, but even putting quotes around the string values would help.
Screenshots
Configuration
| key | value |
|---|---|
| version | 0.85.0 |
| branch | |
| commit_hash | |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.72.1 (d5c2e9c34 2023-09-13) |
| rust_channel | stable-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.72.1 (103a7ff2e 2023-08-15) |
| build_time | 2023-09-25 16:17:07 +02:00 |
| build_rust_channel | release |
| allocator | mimalloc |
| features | dataframe, default, sqlite, trash, which, zip |
| installed_plugins |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemA:std-libraryDefining and improving the standard library written in NuDefining and improving the standard library written in Nutestsissues to add tests or fix testsissues to add tests or fix tests
