123456789101112131415161718192021 |
- package kata_test
- import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- . "code.osinet.fr/fgm/codewars/kyu7/the_baum_sweet_sequence"
- )
- var _ = Describe("Baum-Sweet", func() {
- It("20 elements", func() {
- arr := make([]int, 20)
- p := make(chan int, 100)
- go BaumSweet(p)
- for i := 0; i < 20; i++ {
- arr[i] = <-p
- }
- Expect(arr).To(Equal([]int{1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1}))
- })
- })
|