import 'mocha' ; import * as assert from 'assert' ; import BitSource from './../../../core/common/BitSource' ; author Sean Owen
  describe ( "BitSourceTestCase" , ( ) => { it ( "testSource" , ( ) => { const bytes = Uint8Array . from ( [ 1 , 2 , 3 , 4 , 5 ] ) ; const source = new BitSource ( bytes ) ; assert . strictEqual ( source . available ( ) , 40 ) ; assert . strictEqual ( source . readBits ( 1 ) , 0 ) ; assert . strictEqual ( source . available ( ) , 39 ) ; assert . strictEqual ( source . readBits ( 6 ) , 0 ) ; assert . strictEqual ( source . available ( ) , 33 ) ; assert . strictEqual ( source . readBits ( 1 ) , 1 ) ; assert . strictEqual ( source . available ( ) , 32 ) ; assert . strictEqual ( source . readBits ( 8 ) , 2 ) ; assert . strictEqual ( source . available ( ) , 24 ) ; assert . strictEqual ( source . readBits ( 10 ) , 12 ) ; assert . strictEqual ( source . available ( ) , 14 ) ; assert . strictEqual ( source . readBits ( 8 ) , 16 ) ; assert . strictEqual ( source . available ( ) , 6 ) ; assert . strictEqual ( source . readBits ( 6 ) , 5 ) ; assert . strictEqual ( source . available ( ) , 0 ) ; } ) ; } ) ;