Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ipfreely-uk committed Jun 15, 2024
1 parent ab46b4f commit ae1880f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ip/navigate_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/ipfreely-uk/go/ip"
"github.com/ipfreely-uk/go/ip/compare"
)

func TestExampleNext(t *testing.T) {
Expand All @@ -22,7 +23,7 @@ func Ascend[A ip.Address[A]](lowest, highest A) {
current := lowest
for {
println(current.String())
if current.Compare(highest) == 0 {
if compare.Eq(current, highest) {
break
}
current = ip.Next(current)
Expand All @@ -45,7 +46,7 @@ func Descend[A ip.Address[A]](highest, lowest A) {
current := highest
for {
println(current.String())
if current.Compare(lowest) == 0 {
if compare.Eq(current, lowest) {
break
}
current = ip.Prev(current)
Expand Down

0 comments on commit ae1880f

Please sign in to comment.