Skip to content

Instantly share code, notes, and snippets.

@sassman
Created September 8, 2019 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sassman/9b20377bb1a853476aae45636dd6f413 to your computer and use it in GitHub Desktop.
Save sassman/9b20377bb1a853476aae45636dd6f413 to your computer and use it in GitHub Desktop.
rust tdd: test/alphabet_position_test.rs
// test/alphabet_position_test.rs
use dev_challenge_47::alphabet_position; // <-- we don't have this function yet
#[test] // <-- how to define a test in rust
fn it_should_replace_the_a_with_1() { // <-- we express the requirement as name
let replaced = alphabet_position("a");
assert_eq!(replaced, "1"); // <-- we assert that the both are equal
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment