<commit_before>/// <reference path="../typings/tape/tape.d.ts"/>

import * as test from 'tape';
import { BitOperations } from '../src/bit-operations';

let testLeastSignificantBit = (input: number, output: number) => {
  test(`it gets the correct least significant bit [TestCase: ${input}]`, (t) => {
    let lsb = BitOperations.getLeastSignificantBit(input);

    t.equal(lsb, output);
    t.end();
  });
};

for (let testCase of [[0b0001, 1], [0b0010, 0], [0b0101, 1], [0b1010, 0],
    [0b0111, 1], [0b1111, 1], [0b0000, 0], [0b10100111, 1]]) {
  testLeastSignificantBit(testCase[0], testCase[1]);
}<commit_msg>Test most significant bit<commit_after>/// <reference path="../typings/tape/tape.d.ts"/>

import * as test from 'tape';
import { BitOperations } from '../src/bit-operations';

let testLeastSignificantBit = (input: number, output: number) => {
  test(`it gets the correct least significant bit [TestCase: ${input}]`, (t) => {
    let lsb = BitOperations.getLeastSignificantBit(input);

    t.equal(lsb, output);
    t.end();
  });
};

for (let testCase of [[0b0001, 1], [0b0010, 0], [0b0101, 1], [0b1010, 0],
    [0b0111, 1], [0b1111, 1], [0b0000, 0], [0b10100111, 1]]) {
  testLeastSignificantBit(testCase[0], testCase[1]);
}

let testMostSignificantBit = (input: number, output: number) => {
  test(`it gets the correct most significant bit [TestCase: ${input}]`, (t) => {
    let lsb = BitOperations.getMostSignificantBit(input);

    t.equal(lsb, output);
    t.end();
  });
};

for (let testCase of [[0b0001, 0], [0b0010, 0], [0b0101, 0], [0b1010, 1],
    [0b0111, 0], [0b1111, 1], [0b0000, 0], [0b10100111, 1]]) {
  testMostSignificantBit(testCase[0], testCase[1]);
}
{'fraction_non_alphanumeric': 0.19584569732937684, 'fraction_numerical': 0.09614243323442137, 'mean_word_length': 4.403846153846154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '787463', 'n_tokens_mistral': 739, 'n_tokens_neox': 637, 'n_words': 159}