| 25 | ) |
| 26 | |
| 27 | func TestNewLevelDBKey(t *testing.T) { |
| 28 | Convey("new bytes", t, func() { |
| 29 | log.SetLevel(log.DebugLevel) |
| 30 | So(ConcatAll(nil), ShouldResemble, []byte{}) |
| 31 | So(ConcatAll([]byte{}), ShouldResemble, []byte{}) |
| 32 | So(ConcatAll([]byte{'0'}, []byte{'1'}), ShouldResemble, []byte{'0', '1'}) |
| 33 | So(ConcatAll([]byte{'0'}, nil), ShouldResemble, []byte{'0'}) |
| 34 | So(ConcatAll(nil, []byte{'0'}), ShouldResemble, []byte{'0'}) |
| 35 | So(ConcatAll([]byte{'0', '1', '2', '3'}, []byte{'a', 'b', 'c', 'd', 'e'}, []byte{'x', 'y', 'z'}), |
| 36 | ShouldResemble, []byte{'0', '1', '2', '3', 'a', 'b', 'c', 'd', 'e', 'x', 'y', 'z'}) |
| 37 | So(ConcatAll([]byte{'0', '1', '2', '3'}, nil, []byte{'x', 'y', 'z'}), |
| 38 | ShouldResemble, []byte{'0', '1', '2', '3', 'x', 'y', 'z'}) |
| 39 | So(ConcatAll([]byte{'0', '1', '2', '3'}, []byte{}, []byte{'x', 'y', 'z'}), |
| 40 | ShouldResemble, []byte{'0', '1', '2', '3', 'x', 'y', 'z'}) |
| 41 | So(ConcatAll(nil, []byte{'0', '1', '2', '3'}, nil, []byte{'x', 'y', 'z'}), |
| 42 | ShouldResemble, []byte{'0', '1', '2', '3', 'x', 'y', 'z'}) |
| 43 | So(ConcatAll([]byte{}, []byte{'0', '1', '2', '3'}, nil, []byte{'x', 'y', 'z'}, nil), |
| 44 | ShouldResemble, []byte{'0', '1', '2', '3', 'x', 'y', 'z'}) |
| 45 | }) |
| 46 | } |