diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-05-23 03:53:37 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-05-25 06:39:19 +0800 |
commit | fdea260e41111f3d27c05ab2d2523d2473c1ac05 (patch) | |
tree | 9152d653830781d4f7bdb8b78655dea30647fde0 /packages/contracts/test/libraries | |
parent | 9af77dc835b50d957c308d6de83d26b089ec6e43 (diff) | |
download | dexon-sol-tools-fdea260e41111f3d27c05ab2d2523d2473c1ac05.tar dexon-sol-tools-fdea260e41111f3d27c05ab2d2523d2473c1ac05.tar.gz dexon-sol-tools-fdea260e41111f3d27c05ab2d2523d2473c1ac05.tar.bz2 dexon-sol-tools-fdea260e41111f3d27c05ab2d2523d2473c1ac05.tar.lz dexon-sol-tools-fdea260e41111f3d27c05ab2d2523d2473c1ac05.tar.xz dexon-sol-tools-fdea260e41111f3d27c05ab2d2523d2473c1ac05.tar.zst dexon-sol-tools-fdea260e41111f3d27c05ab2d2523d2473c1ac05.zip |
Cleanup tests
Diffstat (limited to 'packages/contracts/test/libraries')
-rw-r--r-- | packages/contracts/test/libraries/lib_bytes.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts index fc28c363b..968bac300 100644 --- a/packages/contracts/test/libraries/lib_bytes.ts +++ b/packages/contracts/test/libraries/lib_bytes.ts @@ -250,8 +250,14 @@ describe('LibBytes', () => { */ describe('readFirst4', () => { + it('should revert if byte array has a length < 4', async () => { + const byteArrayLessThan4Bytes = '0x010101'; + return expect(libBytes.publicReadFirst4.callAsync(byteArrayLessThan4Bytes)).to.be.rejectedWith( + constants.REVERT, + ); + }); it('should return the first 4 bytes of a byte array of arbitrary length', async () => { - const first4Bytes = libBytes.publicReadFirst4.callAsync(byteArrayLongerThan32Bytes); + const first4Bytes = await libBytes.publicReadFirst4.callAsync(byteArrayLongerThan32Bytes); const expectedFirst4Bytes = byteArrayLongerThan32Bytes.slice(0, 10); expect(first4Bytes).to.equal(expectedFirst4Bytes); }); |