예제 #1
0
파일: graph.go 프로젝트: jmnarloch/gograph
func (g *graph) Adjacent(vertex int) iterator.Iterator {
	return listit.New(g.adjacent[vertex])
}
예제 #2
0
import (
	. "github.com/jmnarloch/gograph/iterator/list"

	"container/list"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("List", func() {

	count := 10
	var l *list.List
	var iterator *ListIterator

	BeforeEach(func() {
		l = list.New()

		for num := 0; num < count; num++ {
			l.PushBack(num)
		}

		iterator = New(l)
	})

	It("Should create list iterator", func() {

		Expect(iterator).NotTo(BeNil())
	})

	It("Should iterate over list elements", func() {