import 'mocha' ; import * as assert from 'assert' ; import Version from './../../../../core/qrcode/decoder/Version' ; import Mode from './../../../../core/qrcode/decoder/Mode' ; author Sean Owen
  describe ( "ModeTestCase" , ( ) => { it ( "testForBits" , ( ) => { assert . strictEqual ( Mode . TERMINATOR . equals ( Mode . forBits ( 0x00 ) ) , true ) ; assert . strictEqual ( Mode . NUMERIC . equals ( Mode . forBits ( 0x01 ) ) , true ) ; assert . strictEqual ( Mode . ALPHANUMERIC . equals ( Mode . forBits ( 0x02 ) ) , true ) ; assert . strictEqual ( Mode . BYTE . equals ( Mode . forBits ( 0x04 ) ) , true ) ; assert . strictEqual ( Mode . KANJI . equals ( Mode . forBits ( 0x08 ) ) , true ) ; try { Mode . forBits ( 0x10 ) ; assert . ok ( false , "Should have thrown an exception" ) ; } catch ( iae ) { } } ) ; it ( "testCharacterCount" , ( ) => { assert . strictEqual ( Mode . NUMERIC . getCharacterCountBits ( Version . getVersionForNumber ( 5 ) ) , 10 ) ; assert . strictEqual ( Mode . NUMERIC . getCharacterCountBits ( Version . getVersionForNumber ( 26 ) ) , 12 ) ; assert . strictEqual ( Mode . NUMERIC . getCharacterCountBits ( Version . getVersionForNumber ( 40 ) ) , 14 ) ; assert . strictEqual ( Mode . ALPHANUMERIC . getCharacterCountBits ( Version . getVersionForNumber ( 6 ) ) , 9 ) ; assert . strictEqual ( Mode . BYTE . getCharacterCountBits ( Version . getVersionForNumber ( 7 ) ) , 8 ) ; assert . strictEqual ( Mode . KANJI . getCharacterCountBits ( Version . getVersionForNumber ( 8 ) ) , 8 ) ; } ) ; } ) ;