<commit_before># -*- encoding: us-ascii -*-
describe :string_succ, :shared => true do
  it "returns an empty string for empty strings" do
    "".send(@method).should == ""
  end

  it "returns the successor by increasing the rightmost alphanumeric (digit => digit, letter => letter with same case)" do
    "abcd".send(@method).should == "abce"
    "THX1138".send(@method).should == "THX1139"

    "<<koala>>".send(@method).should == "<<koalb>>"
    "==A??".send(@method).should == "==B??"
  end

  it "increases non-alphanumerics (via ascii rules) if there are no alphanumerics" do
    "***".send(@method).should == "**+"
    "**`".send(@method).should == "**a"
  end

  it "increases the next best alphanumeric (jumping over non-alphanumerics) if there is a carry" do
    "dz".send(@method).should == "ea"
    "HZ".send(@method).should == "IA"
    "49".send(@method).should == "50"

    "izz".send(@method).should == "jaa"
    "IZZ".send(@method).should == "JAA"
    "699".send(@method).should == "700"

    "6Z99z99Z".send(@method).should == "7A00a00A"

    "1999zzz".send(@method).should == "2000aaa"
    "NZ/[]ZZZ9999".send(@method).should == "OA/[]AAA0000"
  end

  it "increases the next best character if there is a carry for non-alphanumerics" do
    "(\xFF".send(@method).should == ")\x00"
    "`\xFF".send(@method).should == "a\x00"
    "<\xFF\xFF".send(@method).should == "=\x00\x00"
  end

  it "adds an additional character (just left to the last increased one) if there is a carry and no character left to increase" do
    "z".send(@method).should == "aa"
    "Z".send(@method).should == "AA"
    "9".send(@method).should == "10"

    "zz".send(@method).should == "aaa"
    "ZZ".send(@method).should == "AAA"
    "99".send(@method).should == "100"

    "9Z99z99Z".send(@method).should == "10A00a00A"

    "ZZZ9999".send(@method).should == "AAAA0000"
    "/[]ZZZ9999".send(@method).should == "/[]AAAA0000"
    "Z/[]ZZZ9999".send(@method).should == "AA/[]AAA0000"

    # non-alphanumeric cases<commit_msg>Missing case: "/[]9999".succ should be "/[]10000"<commit_after># -*- encoding: us-ascii -*-
describe :string_succ, :shared => true do
  it "returns an empty string for empty strings" do
    "".send(@method).should == ""
  end

  it "returns the successor by increasing the rightmost alphanumeric (digit => digit, letter => letter with same case)" do
    "abcd".send(@method).should == "abce"
    "THX1138".send(@method).should == "THX1139"

    "<<koala>>".send(@method).should == "<<koalb>>"
    "==A??".send(@method).should == "==B??"
  end

  it "increases non-alphanumerics (via ascii rules) if there are no alphanumerics" do
    "***".send(@method).should == "**+"
    "**`".send(@method).should == "**a"
  end

  it "increases the next best alphanumeric (jumping over non-alphanumerics) if there is a carry" do
    "dz".send(@method).should == "ea"
    "HZ".send(@method).should == "IA"
    "49".send(@method).should == "50"

    "izz".send(@method).should == "jaa"
    "IZZ".send(@method).should == "JAA"
    "699".send(@method).should == "700"

    "6Z99z99Z".send(@method).should == "7A00a00A"

    "1999zzz".send(@method).should == "2000aaa"
    "NZ/[]ZZZ9999".send(@method).should == "OA/[]AAA0000"
  end

  it "increases the next best character if there is a carry for non-alphanumerics" do
    "(\xFF".send(@method).should == ")\x00"
    "`\xFF".send(@method).should == "a\x00"
    "<\xFF\xFF".send(@method).should == "=\x00\x00"
  end

  it "adds an additional character (just left to the last increased one) if there is a carry and no character left to increase" do
    "z".send(@method).should == "aa"
    "Z".send(@method).should == "AA"
    "9".send(@method).should == "10"

    "zz".send(@method).should == "aaa"
    "ZZ".send(@method).should == "AAA"
    "99".send(@method).should == "100"

    "9Z99z99Z".send(@method).should == "10A00a00A"

    "ZZZ9999".send(@method).should == "AAAA0000"
    "/[]9999".send(@method).should == "/[]10000"
    "/[]ZZZ9999".send(@method).should == "/[]AAAA0000"
    "Z/[]ZZZ9999".send(@method).should == "AA/[]AAA0000"

    # non-alphanumeric cases
{'fraction_non_alphanumeric': 0.21291575625151735, 'fraction_numerical': 0.05049769361495508, 'mean_word_length': 3.6396396396396398, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '3712871', 'n_tokens_mistral': 1619, 'n_tokens_neox': 1435, 'n_words': 330}