add_test.go 257 B

1234567891011121314151617181920212223
  1. // Author: simon
  2. // Author: ynwdlxm@163.com
  3. // Date: 2025/2/12 09:58
  4. // Desc:
  5. package add
  6. import (
  7. "testing"
  8. )
  9. func TestAdd(t *testing.T) {
  10. a := 2
  11. b := 3
  12. exp := 5
  13. res := add(a, b)
  14. if exp != res {
  15. t.Errorf("Expected %d, got %d.", exp, res)
  16. }
  17. }