Skip to content

Commit

Permalink
Unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ipfreely-uk committed Apr 4, 2024
1 parent 0e6c687 commit 2bec099
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ip/network/empty_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package network_test

import (
"math/big"
"testing"

"github.com/ipfreely-uk/go/ip"
"github.com/ipfreely-uk/go/ip/network"
"github.com/stretchr/testify/assert"
)

func TestEmpty(t *testing.T) {
empty := network.NewSet[ip.Address4]()

assert.Equal(t, big.NewInt(0), empty.Size())
assert.False(t, empty.Contains(ip.MaxAddress(ip.V4())))
ok, _ := empty.Addresses()()
assert.False(t, ok)
ok, _ = empty.Ranges()()
assert.False(t, ok)
}

0 comments on commit 2bec099

Please sign in to comment.