comparison_test.go 477 B

1234567891011121314151617181920212223242526
  1. package lntypes
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/require"
  5. )
  6. // TestMin tests getting correct minimal numbers.
  7. func TestMin(t *testing.T) {
  8. t.Parallel()
  9. require.Equal(t, 1, Min(1, 1))
  10. require.Equal(t, 1, Min(1, 2))
  11. require.Equal(t, 1.5, Min(1.5, 2.5))
  12. }
  13. // TestMax tests getting correct maximal numbers.
  14. func TestMax(t *testing.T) {
  15. t.Parallel()
  16. require.Equal(t, 1, Max(1, 1))
  17. require.Equal(t, 2, Max(1, 2))
  18. require.Equal(t, 2.5, Max(1.5, 2.5))
  19. }