Skip to content

Cargo documentation test page should have link or example on how to define a test #10415

@davidpaulmcintyre

Description

@davidpaulmcintyre

Problem

A google search for “cargo test” takes me to this page https://doc.rust-lang.org/cargo/commands/cargo-test.html, which is also the top result returned when searching from within https://doc.rust-lang.org/stable/cargo/.

As a new rust user, i feel that there are only 2 code snippets i need from this page:

  • cargo test
  • #[test]

The first item is present, the second is not. If this second bit of info is not present on this page (maybe justifiably bc there are different test types), there should be a link to a page that does contain it, notably https://doc.rust-lang.org/stable/cargo/reference/cargo-targets.html?highlight=cargo%20test#tests.

i would be happy to submit pr if this is acceptable.

Steps

  1. search for "cargo test" in a search engine or from w/in the cargo search box
  2. open result, which is https://doc.rust-lang.org/cargo/commands/cargo-test.html
  3. observe there is no assistance in how to define a test or where to find this info

Possible Solution(s)

Under "SEE ALSO" there should be a link to https://doc.rust-lang.org/stable/cargo/reference/cargo-targets.html?highlight=cargo%20test#tests w/ the description "How to define a test".

Notes

if everyone agrees w/ me, pls assign this to me and i'll create a pr w/ a link

Version

current version of the online docs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions