Created
September 8, 2019 22:29
-
-
Save sassman/9b20377bb1a853476aae45636dd6f413 to your computer and use it in GitHub Desktop.
rust tdd: test/alphabet_position_test.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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