<commit_before>require 'spec_helper'

describe Md2pukiwiki do
  describe "#convert" do
    it "should convert header" do
      expect(Md2pukiwiki.convert("# header")).to eq "*header"
    end

    it "should convert sub-header" do
      expect(Md2pukiwiki.convert("## header")).to eq "**header"
    end

    it "should convert list" do
      expect(Md2pukiwiki.convert("* list")).to eq "- list"
    end

    it "should convert nested list" do
      expect(Md2pukiwiki.convert("    * list")).to eq "-- list"
    end

    it "should convert numbered list" do
      expect(Md2pukiwiki.convert("1. list")).to eq "+ list"
    end

    it "should convert nested numbered list" do
      expect(Md2pukiwiki.convert("    1. list")).to eq "++ list"
    end
  end
end
<commit_msg>Convert multi-line text<commit_after>require 'spec_helper'

describe Md2pukiwiki do
  describe "#convert" do
    it "should convert header" do
      expect(Md2pukiwiki.convert("# header")).to eq "*header"
    end

    it "should convert sub-header" do
      expect(Md2pukiwiki.convert("## header")).to eq "**header"
    end

    it "should convert list" do
      expect(Md2pukiwiki.convert("* list")).to eq "- list"
    end

    it "should convert nested list" do
      expect(Md2pukiwiki.convert("    * list")).to eq "-- list"
    end

    it "should convert numbered list" do
      expect(Md2pukiwiki.convert("1. list")).to eq "+ list"
    end

    it "should convert nested numbered list" do
      expect(Md2pukiwiki.convert("    1. list")).to eq "++ list"
    end

    it "should convert multi-line text" do
      markdown = <<-EOS.strip
# header
* list1
* list2
    * list2.1

## subheader
1. nlist1
2. nlist2
    1. nlist2.1
      EOS

      pukiwiki = <<-EOS.strip
*header
- list1
- list2
-- list2.1

**subheader
+ nlist1
+ nlist2
++ nlist2.1
      EOS

      expect(Md2pukiwiki.convert(markdown)).to eq pukiwiki
    end
  end
end

{'fraction_non_alphanumeric': 0.1248688352570829, 'fraction_numerical': 0.01993704092339979, 'mean_word_length': 2.6885880077369437, 'pattern_counts': {'":': 0, '<': 7, '<?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': '205855', 'n_tokens_mistral': 680, 'n_tokens_neox': 654, 'n_words': 187}