11/* eslint-env mocha */
22
33import { expect } from 'aegir/chai'
4+ import { alloc } from '../src/alloc.js'
45import { concat } from '../src/concat.js'
56
67describe ( 'Uint8Array concat' , ( ) => {
@@ -20,25 +21,9 @@ describe('Uint8Array concat', () => {
2021 expect ( concat ( [ a , b ] , 8 ) ) . to . deep . equal ( c )
2122 } )
2223
23- it ( 'concats mixed Uint8Arrays and Arrays' , ( ) => {
24- const a = Uint8Array . from ( [ 0 , 1 , 2 , 3 ] )
25- const b = [ 4 , 5 , 6 , 7 ]
26- const c = Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] )
27-
28- expect ( concat ( [ a , b ] ) ) . to . deep . equal ( c )
29- } )
30-
31- it ( 'concats mixed Uint8Arrays and Arrays with a length' , ( ) => {
32- const a = Uint8Array . from ( [ 0 , 1 , 2 , 3 ] )
33- const b = [ 4 , 5 , 6 , 7 ]
34- const c = Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] )
35-
36- expect ( concat ( [ a , b ] , 8 ) ) . to . deep . equal ( c )
37- } )
38-
3924 it ( 'concat returns Uint8Array' , ( ) => {
4025 const a = Uint8Array . from ( [ 0 , 1 , 2 , 3 ] )
41- const b = [ 4 , 5 , 6 , 7 ]
26+ const b = alloc ( 10 ) . fill ( 1 )
4227 const c = concat ( [ a , b ] )
4328 const slice = c . slice ( )
4429
0 commit comments