<commit_before>import assert from 'assert';
import CommentParser from '../../../src/Parser/CommentParser.js';

/** @test {CommentParser} */
describe('CommentParser:', ()=>{
  /** @test {CommentParser.parse} */
  it('can parse doc comment.', ()=>{
    let value = `*
* this is desc.
* @tag1
* @tag2 tag2 value
* @tag3 tag3 value
* tag3 second value
*
* @tag4 tag4 value
*
`;
    let comment = {type: 'Block', value: value};
    let tags = CommentParser.parse(comment);
    assert.equal(tags.length, 5);
    assert.deepEqual(tags[0], {tagName: '@desc', tagValue: 'this is desc.'});
    assert.deepEqual(tags[1], {tagName: '@tag1', tagValue: ''});
    assert.deepEqual(tags[2], {tagName: '@tag2', tagValue: 'tag2 value'});
    assert.deepEqual(tags[3], {tagName: '@tag3', tagValue: 'tag3 value\ntag3 second value'});
    assert.deepEqual(tags[4], {tagName: '@tag4', tagValue: 'tag4 value'});
  });

  it('can parse doc comments with trailing tabs', ()=>{
      let value = `*
\t* this is desc.
\t* @tag1
\t* @tag2 tag2 value
\t* @tag3 tag3 value
\t* tag3 second value
\t*
\t* @tag4 tag4 value
\t*
`;
    let comment = {type: 'Block', value: value};
    let tags = CommentParser.parse(comment);
    assert.equal(tags.length, 5);<commit_msg>add /** @test {CommentParser.parse} */<commit_after>import assert from 'assert';
import CommentParser from '../../../src/Parser/CommentParser.js';

/** @test {CommentParser} */
describe('CommentParser:', ()=>{
  /** @test {CommentParser.parse} */
  it('can parse doc comment.', ()=>{
    let value = `*
* this is desc.
* @tag1
* @tag2 tag2 value
* @tag3 tag3 value
* tag3 second value
*
* @tag4 tag4 value
*
`;
    let comment = {type: 'Block', value: value};
    let tags = CommentParser.parse(comment);
    assert.equal(tags.length, 5);
    assert.deepEqual(tags[0], {tagName: '@desc', tagValue: 'this is desc.'});
    assert.deepEqual(tags[1], {tagName: '@tag1', tagValue: ''});
    assert.deepEqual(tags[2], {tagName: '@tag2', tagValue: 'tag2 value'});
    assert.deepEqual(tags[3], {tagName: '@tag3', tagValue: 'tag3 value\ntag3 second value'});
    assert.deepEqual(tags[4], {tagName: '@tag4', tagValue: 'tag4 value'});
  });

    /** @test {CommentParser.parse} */
  it('can parse doc comments with trailing tabs', ()=>{
      let value = `*
\t* this is desc.
\t* @tag1
\t* @tag2 tag2 value
\t* @tag3 tag3 value
\t* tag3 second value
\t*
\t* @tag4 tag4 value
\t*
`;
    let comment = {type: 'Block', value: value};
    let tags = CommentParser.parse(comment);
    assert.equal(tags.length, 5);
{'fraction_non_alphanumeric': 0.1971608832807571, 'fraction_numerical': 0.02444794952681388, 'mean_word_length': 3.8508604206500956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3504890', 'n_tokens_mistral': 907, 'n_tokens_neox': 898, 'n_words': 246}