utils_test.go 437 B

123456789101112131415161718192021
  1. package sarama
  2. import "testing"
  3. func TestVersionCompare(t *testing.T) {
  4. if V0_8_2_0.IsAtLeast(V0_8_2_1) {
  5. t.Error("0.8.2.0 >= 0.8.2.1")
  6. }
  7. if !V0_8_2_1.IsAtLeast(V0_8_2_0) {
  8. t.Error("! 0.8.2.1 >= 0.8.2.0")
  9. }
  10. if !V0_8_2_0.IsAtLeast(V0_8_2_0) {
  11. t.Error("! 0.8.2.0 >= 0.8.2.0")
  12. }
  13. if !V0_9_0_0.IsAtLeast(V0_8_2_1) {
  14. t.Error("! 0.9.0.0 >= 0.8.2.1")
  15. }
  16. if V0_8_2_1.IsAtLeast(V0_10_0_0) {
  17. t.Error("0.8.2.1 >= 0.10.0.0")
  18. }
  19. }