<commit_before>package de.paul_woitaschek.slimber

import d
import e
import i
import org.assertj.core.api.Assertions.assertThat
import org.junit.After
import org.junit.Before
import org.junit.Test
import timber.log.Timber
import timber.log.Timber.tag
import v
import w
import wtf


/**
 * JUnit tests for Slimber
 *
 * @author <NAME>
 */
class SlimberTest {

  @Before @After fun setUpAndTearDown() {
    // clear timber after each test
    Timber.uprootAll()
  }

  /** Tests that the log messages arrive */
  @Test fun testLogs() {
    val loggingTree = LoggingTree()
    Timber.plant(loggingTree)

    tag("i")
    i { "info" }

    tag("d")
    d { "debug" }

    tag("w")
    w { "warn" }

    tag("e")
    e { "error" }

    tag("v")
    v { "verbose" }

    tag("wtf")
    wtf { "assert" }

    assertThat(loggingTree.logs())
      .containsExactly(
        LogItem.i("i", "info"),
        LogItem.d("d", "debug"),
        LogItem.w("w", "warn"),
        LogItem.e("e", "error"),
        LogItem.v("v", "verbose"),
        LogItem.wtf("wtf", "assert")
      )
  }

  /** test that the blocks are not executed when there are no trees planted */
  @Test fun testBlockNotExecuted() {
    val logThrowable = RuntimeException()

    i { throw AssertionError() }
    i(logThrowable) { throw AssertionError() }

    d { throw AssertionError() }
    d(logThrowable) { throw AssertionError() }

    w { throw AssertionError() }
    w(logThrowable) { throw AssertionError() }

    e { throw AssertionError() }
    e(logThrowable) { throw AssertionError() }

    v { throw AssertionError() }
    v(logThrowable) { throw AssertionError() }

    wtf { throw AssertionError() }
    wtf(logThrowable) { throw AssertionError() }
  }
}<commit_msg>Extract the throwing action. Added a dummy failing test to check  if ci works.<commit_after>package de.paul_woitaschek.slimber

import d
import e
import i
import org.assertj.core.api.Assertions.assertThat
import org.junit.After
import org.junit.Before
import org.junit.Test
import timber.log.Timber
import timber.log.Timber.tag
import v
import w
import wtf


/**
 * JUnit tests for Slimber
 *
 * @author <NAME>
 */
class SlimberTest {

  @Before @After fun setUpAndTearDown() {
    // clear timber after each test
    Timber.uprootAll()
  }

  /** Tests that the log messages arrive */
  @Test fun testLogs() {
    val loggingTree = LoggingTree()
    Timber.plant(loggingTree)

    tag("i")
    i { "info" }

    tag("d")
    d { "debug" }

    tag("w")
    w { "warn" }

    tag("e")
    e { "error" }

    tag("v")
    v { "verbose" }

    tag("wtf")
    wtf { "assert" }

    assertThat(loggingTree.logs())
      .containsExactly(
        LogItem.i("i", "info"),
        LogItem.d("d", "debug"),
        LogItem.w("w", "warn"),
        LogItem.e("e", "error"),
        LogItem.v("v", "verbose"),
        LogItem.wtf("wtf", "assert")
      )
  }

  /** test that the blocks are not executed when there are no trees planted */
  @Test fun testBlockNotExecuted() {
    val logThrowable = RuntimeException()

    val throwAssertionError = { throw AssertionError() }

    i(throwAssertionError)
    i(logThrowable, throwAssertionError)

    d(throwAssertionError)
    d(logThrowable, throwAssertionError)

    w(throwAssertionError)
    w(logThrowable, throwAssertionError)

    e(throwAssertionError)
    e(logThrowable, throwAssertionError)

    v(throwAssertionError)
    v(logThrowable, throwAssertionError)

    wtf(throwAssertionError)
    wtf(logThrowable, throwAssertionError)
  }

  @Test fun failingTest() {
    throw AssertionError("")
  }
}
{'fraction_non_alphanumeric': 0.13158628380262058, 'fraction_numerical': 0.0, 'mean_word_length': 2.9299014238773275, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3314813', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1192, 'n_words': 292}