@@ -11,7 +11,7 @@ interface ExpectObj {
1111 addEqualityTesters : ( testers : Array < Tester > ) => void
1212}
1313
14- function addEqualityTesters ( expectObj : ExpectObj ) {
14+ function doAddEqualityTesters ( expectObj : ExpectObj ) {
1515 expectObj . addEqualityTesters ( [
1616 function IsSamePrimitiveTypeAndValue ( this : TesterContext , subject , test , customTesters ) : boolean | undefined {
1717 const subjectIsPrimitive = subject instanceof internal . primitives . AlgoTsPrimitiveCls
@@ -44,7 +44,8 @@ function addEqualityTesters(expectObj: ExpectObj) {
4444 } ,
4545 function BytesPrimitiveIsArray ( this : TesterContext , subject , test , customTesters ) : boolean | undefined {
4646 if ( subject instanceof internal . primitives . BytesCls ) {
47- const testValue = Array . isArray ( test ) && test . every ( ( i ) => typeof i === 'number' ) ? new Uint8Array ( test ) : undefined
47+ const testValue =
48+ Array . isArray ( test ) && test . every ( ( i ) => typeof i === 'number' && i >= 0 && i < 256 ) ? new Uint8Array ( test ) : undefined
4849 if ( testValue !== undefined ) return this . equals ( subject . asUint8Array ( ) , testValue , customTesters )
4950 return undefined
5051 }
@@ -108,6 +109,6 @@ function addEqualityTesters(expectObj: ExpectObj) {
108109 ] )
109110}
110111
111- export function setUpTests ( { expect } : { expect : ExpectObj } ) {
112- addEqualityTesters ( expect )
112+ export function addEqualityTesters ( { expect } : { expect : ExpectObj } ) {
113+ doAddEqualityTesters ( expect )
113114}
0 commit comments