<commit_before>describe("Encoding A String", function() {
  var regularString = "A regular string.";

  it("should return a bencoded string of value '17:A regular string.'", function() {
    expect( regularString.encode() ).toEqual( "17:A regular string." );
  });
});

describe("Encoding An Integer", function() {
  var regularInteger = 12345;

  it("should return a bencoded string of value 'i12345e'", function() {
    expect( regularInteger.encode() ).toEqual( "i12345e" );
  });
});

describe("Encoding An Array", function() {
  var array = ["Benny", 123, "john", ["tom", 923] ];

  it("should return a properly bencoded array", function() {
    expect( array.encode() ).toEqual( "l5:Bennyi123e4:johnl3:tomi923eee" );
  });
});

describe("Encoding An Object", function() {
  var object = { one: "ben", two: ["john", 123, "james"], three: { key: "value" } };

  var expectedString = "d3:one3:ben3:twol4:johni123e5:jamese5:threed3:key5:valueee";

  it("should return a properly bencoded Object", function() {
    expect( object.encode() ).toEqual( expectedString );
  });
});<commit_msg>refactored/added more specs for encode<commit_after>describe("Encoding A String", function() {
  var regularString = "A regular string.";

  it("should return a bencoded string of value '17:A regular string.'", function() {
    expect( regularString.encode() ).toEqual( "17:A regular string." );
  });
});

describe("Encoding An Integer", function() {
  var regularInteger = 12345;

  it("should return a bencoded string of value 'i12345e'", function() {
    expect( regularInteger.encode() ).toEqual( "i12345e" );
  });

  it("should return properly bencoded string of value 'i-1234e' when number is negative", function() {
    var num = -1234;
    expect( num.encode() ).toEqual( "i-1234e" );
  });
});

describe("Encoding An Array", function() {
  var array = ["Benny", 123, "john", ["tom", -923], { one: "value one" } ];

  var bencodedString = "l5:Bennyi123e4:johnl3:tomi-923eed3:one9:value oneee";

  it("should return a properly bencoded array", function() {
    expect( array.encode() ).toEqual( bencodedString );
  });
});

describe("Encoding An Object", function() {
  var object = { one: "ben", two: ["john", 123, "james"], three: { key: "value" } };

  var bencodedString = "d3:one3:ben3:twol4:johni123e5:jamese5:threed3:key5:valueee";

  it("should return a properly bencoded Object", function() {
    expect( object.encode() ).toEqual( bencodedString );
  });
});
{'fraction_non_alphanumeric': 0.17470612079448722, 'fraction_numerical': 0.04458856911228212, 'mean_word_length': 4.647597254004577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7564521', 'n_tokens_mistral': 870, 'n_tokens_neox': 789, 'n_words': 225}