<commit_before>var assert = require("assert");

var binary_key = new Buffer("<KEY> 'base64')
var keyName = (new Buffer("<KEY>", 'base64')).toString();

var bencode = require('../bencode.js');
describe("bencode", function() {
  describe("#decode()", function() {
    it('should be able to decode a number', function() {
      assert.equal(bencode.decode('i123e'), 123);
      assert.equal(bencode.decode('i123.5e'), 123.5);
    });
    it('should be able to decode a string', function() {
      assert.equal(bencode.decode('5:asdfe'), 'asdfe');
      assert.equal(bencode.decode('4:öö'), 'öö');
      assert.equal(bencode.decode('4:öö', 'utf8'), 'öö');
    });
    it('should be able to decode "binary keys"', function() {
      assert.equal(true, bencode.decode(binary_key).files.hasOwnProperty([keyName]));
    });
    it('should be able to decode a dictionary', function() {
      var out;<commit_msg>not an array! a string!!<commit_after>var assert = require("assert");

var binary_key = new Buffer("<KEY> 'base64')
var keyName = (new Buffer("N++/vVXvv73go5rvv71L77+9z6fXlu+/ve+/ve+/ve+/vSR3", 'base64')).toString();

var bencode = require('../bencode.js');
describe("bencode", function() {
  describe("#decode()", function() {
    it('should be able to decode a number', function() {
      assert.equal(bencode.decode('i123e'), 123);
      assert.equal(bencode.decode('i123.5e'), 123.5);
    });
    it('should be able to decode a string', function() {
      assert.equal(bencode.decode('5:asdfe'), 'asdfe');
      assert.equal(bencode.decode('4:öö'), 'öö');
      assert.equal(bencode.decode('4:öö', 'utf8'), 'öö');
    });
    it('should be able to decode "binary keys"', function() {
      assert.equal(true, bencode.decode(binary_key).files.hasOwnProperty(keyName));
    });
    it('should be able to decode a dictionary', function() {
      var out;
{'fraction_non_alphanumeric': 0.197524219590958, 'fraction_numerical': 0.02906350914962325, 'mean_word_length': 4.192737430167598, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6160692', 'n_tokens_mistral': 643, 'n_tokens_neox': 612, 'n_words': 137}