Update dependencies

- uses newer version of go-ethereum required for go1.11
This commit is contained in:
Rob Mulholand
2018-09-13 16:14:35 -05:00
parent 939ead0c82
commit 560305f601
2356 changed files with 331656 additions and 128304 deletions
+31 -31
View File
@@ -33,20 +33,20 @@ var _ = Describe("Buffer", func() {
It("should return everything that's been written", func() {
buffer.Write([]byte("abc"))
buffer.Write([]byte("def"))
Ω(buffer.Contents()).Should(Equal([]byte("abcdef")))
Expect(buffer.Contents()).Should(Equal([]byte("abcdef")))
Ω(buffer).Should(Say("bcd"))
Ω(buffer.Contents()).Should(Equal([]byte("abcdef")))
Expect(buffer).Should(Say("bcd"))
Expect(buffer.Contents()).Should(Equal([]byte("abcdef")))
})
})
Describe("creating a buffer with bytes", func() {
It("should create the buffer with the cursor set to the beginning", func() {
buffer := BufferWithBytes([]byte("abcdef"))
Ω(buffer.Contents()).Should(Equal([]byte("abcdef")))
Ω(buffer).Should(Say("abc"))
Ω(buffer).ShouldNot(Say("abc"))
Ω(buffer).Should(Say("def"))
Expect(buffer.Contents()).Should(Equal([]byte("abcdef")))
Expect(buffer).Should(Say("abc"))
Expect(buffer).ShouldNot(Say("abc"))
Expect(buffer).Should(Say("def"))
})
})
@@ -56,7 +56,7 @@ var _ = Describe("Buffer", func() {
reader := bytes.NewBuffer([]byte("abcdef"))
buffer := BufferReader(reader)
Eventually(buffer).Should(Say("abc"))
Ω(buffer).ShouldNot(Say("abc"))
Expect(buffer).ShouldNot(Say("abc"))
Eventually(buffer).Should(Say("def"))
Eventually(buffer.Closed).Should(BeTrue())
})
@@ -72,7 +72,7 @@ var _ = Describe("Buffer", func() {
failures := InterceptGomegaFailures(func() {
Eventually(buffer, 100*time.Millisecond).Should(Say("abc"))
})
Ω(failures).ShouldNot(BeEmpty())
Expect(failures).ShouldNot(BeEmpty())
fastReader := SlowReader{
R: bytes.NewBuffer([]byte("abcdef")),
@@ -91,19 +91,19 @@ var _ = Describe("Buffer", func() {
dest := make([]byte, 3)
n, err := buffer.Read(dest)
Ω(err).ShouldNot(HaveOccurred())
Ω(n).Should(Equal(3))
Ω(string(dest)).Should(Equal("abc"))
Expect(err).ShouldNot(HaveOccurred())
Expect(n).Should(Equal(3))
Expect(string(dest)).Should(Equal("abc"))
dest = make([]byte, 3)
n, err = buffer.Read(dest)
Ω(err).ShouldNot(HaveOccurred())
Ω(n).Should(Equal(2))
Ω(string(dest[:n])).Should(Equal("de"))
Expect(err).ShouldNot(HaveOccurred())
Expect(n).Should(Equal(2))
Expect(string(dest[:n])).Should(Equal("de"))
n, err = buffer.Read(dest)
Ω(err).Should(Equal(io.EOF))
Ω(n).Should(Equal(0))
Expect(err).Should(Equal(io.EOF))
Expect(n).Should(Equal(0))
})
Context("after the buffer has been closed", func() {
@@ -114,8 +114,8 @@ var _ = Describe("Buffer", func() {
dest := make([]byte, 3)
n, err := buffer.Read(dest)
Ω(err).Should(HaveOccurred())
Ω(n).Should(Equal(0))
Expect(err).Should(HaveOccurred())
Expect(n).Should(Equal(0))
})
})
})
@@ -137,7 +137,7 @@ var _ = Describe("Buffer", func() {
Fail("should not have gotten here")
}
Ω(gotIt).Should(BeTrue())
Expect(gotIt).Should(BeTrue())
Eventually(A).Should(BeClosed())
buffer.Write([]byte("f"))
@@ -150,8 +150,8 @@ var _ = Describe("Buffer", func() {
It("should fast-forward the buffer upon detection", func(done Done) {
buffer.Write([]byte("abcde"))
<-buffer.Detect("abc")
Ω(buffer).ShouldNot(Say("abc"))
Ω(buffer).Should(Say("de"))
Expect(buffer).ShouldNot(Say("abc"))
Expect(buffer).Should(Say("de"))
close(done)
})
@@ -159,10 +159,10 @@ var _ = Describe("Buffer", func() {
buffer.Write([]byte("abcde"))
A := buffer.Detect("abc")
time.Sleep(20 * time.Millisecond) //give the goroutine a chance to detect and write to the channel
Ω(buffer).Should(Say("abcd"))
Expect(buffer).Should(Say("abcd"))
<-A
Ω(buffer).ShouldNot(Say("d"))
Ω(buffer).Should(Say("e"))
Expect(buffer).ShouldNot(Say("d"))
Expect(buffer).Should(Say("e"))
Eventually(A).Should(BeClosed())
close(done)
})
@@ -175,7 +175,7 @@ var _ = Describe("Buffer", func() {
Eventually(A).Should(BeClosed())
Eventually(B).Should(BeClosed())
Ω(buffer).Should(Say("bcde"))
Expect(buffer).Should(Say("bcde"))
<-buffer.Detect("f")
close(done)
})
@@ -184,22 +184,22 @@ var _ = Describe("Buffer", func() {
Describe("closing the buffer", func() {
It("should error when further write attempts are made", func() {
_, err := buffer.Write([]byte("abc"))
Ω(err).ShouldNot(HaveOccurred())
Expect(err).ShouldNot(HaveOccurred())
buffer.Close()
_, err = buffer.Write([]byte("def"))
Ω(err).Should(HaveOccurred())
Expect(err).Should(HaveOccurred())
Ω(buffer.Contents()).Should(Equal([]byte("abc")))
Expect(buffer.Contents()).Should(Equal([]byte("abc")))
})
It("should be closed", func() {
Ω(buffer.Closed()).Should(BeFalse())
Expect(buffer.Closed()).Should(BeFalse())
buffer.Close()
Ω(buffer.Closed()).Should(BeTrue())
Expect(buffer.Closed()).Should(BeTrue())
})
})
})