25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

19 lines
264 B

  1. package client
  2. import (
  3. "testing"
  4. )
  5. func TestAutoInc(t *testing.T) {
  6. ai := NewAutoIncId()
  7. previous := ai.Id()
  8. for i := 0; i < 10; i++ {
  9. id := ai.Id()
  10. if id == previous {
  11. t.Errorf("Id not unique, previous and current %s", id)
  12. }
  13. previous = id
  14. }
  15. }