Ticket/InsdepUI/plugin/highlight-9.9.0/test/api/binaryNumber.js

(完整代码) 702B

'use strict';

let hljs = require('../../build');

const pattern = new RegExp(`${hljs.BINARY_NUMBER_RE}$`);

describe('.BINARY_NUMBER_RE', function() {
  it('should match binary numbers', function() {
    const numbers = [ '0b0101', '0b1100', '0b1001'
                    , '0b11110101', '0b11001111'
                    , '0b1010111111000001'
                    ];

    numbers.should.matchEach(pattern);
  });

  it('should not match binary numbers greater than 2', function() {
    const numbers = [ '0b2101', '0b1130', '0b1041'
                    , '0b11150101', '0b11061111'
                    , '0b1010111117000001'
                    ];

    numbers.should.not.matchEach(pattern);
  });
});

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。