<commit_before>package org.codehaus.jparsec;

import org.junit.Test;

import static org.fest.assertions.Assertions.assertThat;

public class PatternScannerTest {

  @Test
  public void returns_incremental_when_parsing_incrementally_given_incomplete_input() throws Exception {
    assertThat(Scanners.lineComment("#").incrementally()
        .parse("# a comment").parse(" more input").isDone()).isFalse();
  }

  @Test
  public void returns_done_when_parsing_incrementally_given_complete_input() throws Exception {
    assertThat(Scanners.lineComment("#").incrementally()
        .parse("# a comment").parse(" more input\n").isDone()).isTrue();
  }

  @Test
  public void returns_done_failed_parsing_incrementally_given_incorrect_input() throws Exception {
    assertThat(Scanners.lineComment("#").incrementally().parse(" a comment\n").isFailed()).isTrue();
  }

}<commit_msg>minor corrections to tests #4<commit_after>package org.codehaus.jparsec;

import org.junit.Test;

import static org.fest.assertions.Assertions.assertThat;

public class PatternScannerTest {

  @Test
  public void returns_incremental_when_parsing_incrementally_given_incomplete_input() throws Exception {
    assertThat(Scanners.lineComment("#").incrementally()
        .parse("# a comment").parse(" more input").isDone()).isFalse();
  }

  @Test
  public void returns_done_when_parsing_incrementally_given_complete_input() throws Exception {
    Parser.Incremental<Void> incremental = Scanners.lineComment("#").incrementally()
        .parse("# a comment");
    assertThat(incremental.parse(" more input\n").isDone()).isTrue();
  }

  @Test
  public void returns_failed_when_parsing_incrementally_given_incorrect_input() throws Exception {
    assertThat(Scanners.lineComment("#").incrementally().parse(" a comment\n").isFailed()).isTrue();
  }

}
{'fraction_non_alphanumeric': 0.12843029637760703, 'fraction_numerical': 0.0005488474204171241, 'mean_word_length': 5.653284671532846, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2140156', 'n_tokens_mistral': 555, 'n_tokens_neox': 539, 'n_words': 93}