<commit_before>package com.episode6.hackit.chop;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@RunWith(ChopTestTestRunner.class)
public class DefaultTaggerTest {

  @Mock Chop.Tree mTree;

  @Before
  public void setUp() {
    when(mTree.supportsLevel(any(Chop.Level.class)))
        .thenReturn(true);

    Chop.plantTree(mTree);
  }

  @Test
  public void testOuterClass() {
    String expectedTag = DefaultTaggerTest.class.getSimpleName();

    Chop.d("Test Message");

    verify(mTree).chopLog(
        any(Chop.Level.class),
        eq(expectedTag),
        anyString()
    );
  }

  @Test
  public void testAnonymousClass() {
    String expectedTag = DefaultTaggerTest.class.getSimpleName();

    new Runnable() {

      @Override
      public void run() {
        Chop.d("Test message");
      }
    }.run();

    verify(mTree).chopLog(
        any(Chop.Level.class),
        eq(expectedTag),
        anyString()
    );
  }

  @After
  public void cleanUp() {
    ChopInternals.TREE_FARM.digUpTree(mTree);
  }
}<commit_msg>Add a test for inner class tags<commit_after>package com.episode6.hackit.chop;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@RunWith(ChopTestTestRunner.class)
public class DefaultTaggerTest {

  @Mock Chop.Tree mTree;

  @Before
  public void setUp() {
    when(mTree.supportsLevel(any(Chop.Level.class)))
        .thenReturn(true);

    Chop.plantTree(mTree);
  }

  @Test
  public void testOuterClass() {
    String expectedTag = DefaultTaggerTest.class.getSimpleName();

    Chop.d("Test Message");

    verifyExpectedTag(expectedTag);
  }

  @Test
  public void testAnonymousClass() {
    String expectedTag = DefaultTaggerTest.class.getSimpleName();

    new Runnable() {

      @Override
      public void run() {
        Chop.d("Test message");
      }
    }.run();

    verifyExpectedTag(expectedTag);
  }

  @Test
  public void testInnerClass() {
    String expectedTag = DefaultTaggerTest.class.getSimpleName() + "$" +
        InnerTestClass.class.getSimpleName();

    new InnerTestClass().printLog();

    verifyExpectedTag(expectedTag);
  }

  @After
  public void cleanUp() {
    ChopInternals.TREE_FARM.digUpTree(mTree);
  }

  private void verifyExpectedTag(String expectedTag) {
    verify(mTree).chopLog(
        any(Chop.Level.class),
        eq(expectedTag),
        anyString());
  }

  private class InnerTestClass {
    public void printLog() {
      Chop.d("Test Message");
    }
  }
}
{'fraction_non_alphanumeric': 0.11914191419141915, 'fraction_numerical': 0.0006600660066006601, 'mean_word_length': 3.342406876790831, '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': '1220363', 'n_tokens_mistral': 1027, 'n_tokens_neox': 989, 'n_words': 185}