Skip to content

add #[should_panic] attribute expect options on tests/*.rs #502

Description

@alejandro-vaz

currently we use a ton of #[should_panic] attributes on our tests

most of them don't include an expect inside them, but some do. tests/bytes.rs:84:

#[should_panic(expected = "advance out of bounds: the len is 8 but advancing by 12")]
fn // ...

to make it consistent all #[should_panic] attributes on tests/*.rs should have an expect reason added to them

some of the exact errors are not deterministic, but the error type is, and since expect matches a substring it's easier to maintain if we just keep the error name without details

good example: "advance out of bounds"

bad examples:

  • the full error with details: "advance out of bounds: the len is 8 but advancing by 12"
  • no expect, just bare #[should_panic]
  • anything that does not match the error name

Metadata

Metadata

Assignees

Labels

good first issueGood for a first contributorhelp wantedNo clear candidate to implement itp-mediumMedium priorityr-testingrelated to testing

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions