forked from p93542168/wheat-cache
test(channelx): add channelx test
This commit is contained in:
parent
c381c57374
commit
19e1bb59a3
|
@ -0,0 +1,19 @@
|
|||
package channelx
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestChannelX_Push(t *testing.T) {
|
||||
c := MakeChannelX(10)
|
||||
require.Equal(t, c.Length(), 0)
|
||||
|
||||
up := c.Push("111")
|
||||
require.Equal(t, 24, int(up))
|
||||
|
||||
res, up := c.Pop()
|
||||
require.Equal(t, 24, int(up))
|
||||
require.Equal(t, res, "111")
|
||||
}
|
Loading…
Reference in New Issue