Skip to content

Commit

Permalink
feat: impl sample test
Browse files Browse the repository at this point in the history
  • Loading branch information
nukopy committed Jan 21, 2024
1 parent f728932 commit 773b23e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
fn main() {
println!("Hello, world!");
}

fn add(a: i32, b: i32) -> i32 {
a + b
}

#[test]
fn test_add() {
// test content: add(1, 2) == 3
// given (prerequisites):
let expected = 3;

// when (operation):
let actual = add(1, 2);

// then (expected results):
assert_eq!(actual, expected, "1 + 2 should be 3");
}

0 comments on commit 773b23e

Please sign in to comment.