两个变量相加
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
346B

  1. // Copyright 2019 GoKeep Author. All rights reserved.
  2. // license that can be found in the LICENSE file.
  3. pub fn add(a: i32, b: i32) -> i32 {
  4. a + b
  5. }
  6. #[cfg(test)]
  7. mod tests {
  8. use super::*;
  9. #[test]
  10. fn test_add() {
  11. assert_eq!(add(1, 2), 3);
  12. }
  13. #[test]
  14. fn it_works() {
  15. assert_eq!(2 + 2, 4);
  16. }
  17. }