rust-lang / rust-lang/rust-by-example

Test Functions Naming Scheme

Open Beginner friendly
#2,031 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Handlebars
Stars
8.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

The naming scheme in (The Rust Programming Language)[https://doc.rust-lang.org/book/ch11-01-writing-tests.html] uses the follwoing naming scheme for tests:

#[cfg(test)]
mod tests {
    #[test]
    fn foo() {
        assert!(true);
    }
}

But within (Rust By Example)[https://doc.rust-lang.org/rust-by-example/testing/unit_testing.html] it uses the following naming scheme for tests:

#[cfg(test)]
mod tests {
    #[test]
    fn test_foo() {
        assert!(true);
    }
}

Rust By Example should use the same naming scheme for tests, as The Rust Programming Language website.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Rust By Example unit testing page mentioned in the issue and compare its test naming example with The Rust Programming Language example. Update the displayed test function name to use the same scheme, then verify the rendered documentation shows the consistent example.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
90/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.