<commit_before>/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2008, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id$


package scala.testing

import scala.collection.mutable.ArrayBuffer

/**
 * <p>
 *   Unit testing methods in the spirit of
 *   <a href="http://www.junit.org/" target="_top">JUnit</a> framework.
 * </p>
 * <p>
 *   Use these classes like this:
 * </p>
 * <pre>
 * <b>import</b> scala.testing.SUnit
 * <b>import</b> SUnit._
 *
 * <b>class</b> MyTest(n: String) <b>extends</b> TestCase(n) {
 *
 *   <b>override def</b> runTest() = n <b>match</b> {
 *     <b>case</b> "myTest1" => assertTrue(<b>true</b>)
 *     <b>case</b> "myTest2" => assertTrue("hello", <b>false</b>)
 *   }
 * }
 *
 * <b>val</b> r = <b>new</b> TestResult()
 * suite.run(r)
 * <b>for</b> (tf &lt;- r.failures()) {
 *   println(tf.toString())
 * }
 * </pre>
 * <p>
 *   The trait <code>TestConsoleMain</code> contains this code as
 *   a <code>main</code> method, for convenience.
 * </p>
 *
 * @author <NAME>
 */
object SUnit {

  /** <p>
   *    Convenience trait, mix it in a <code>TestMain</code> object and
   *    implement "suite" to get this code.
   *  </p><pre>
   *  <b>val</b> r = <b>new</b> TestResult()
   *  suite.run(r)
   *  <b>for</b> (<b>val</b> tf &lt;- r.failures()) {
   *    println(tf.toString())
   *  </pre>
   */
  trait TestConsoleMain {
    def suite: TestSuite
    def main(args: Array[String]) {
      val r = new TestResult()
      suite.run(r)
      for (tf <- r.failures())
        println(tf.toString())
    }
  }

  /** a Test can be run with its result being collected */
  trait Test {
    def run(r: TestResult): Unit
  }
<commit_msg>deprecated SUnit<commit_after>/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2008, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id$


package scala.testing

import scala.collection.mutable.ArrayBuffer

/**
 * <p>
 *   Unit testing methods in the spirit of
 *   <a href="http://www.junit.org/" target="_top">JUnit</a> framework.
 * </p>
 * <p>
 *   Use these classes like this:
 * </p>
 * <pre>
 * <b>import</b> scala.testing.SUnit
 * <b>import</b> SUnit._
 *
 * <b>class</b> MyTest(n: String) <b>extends</b> TestCase(n) {
 *
 *   <b>override def</b> runTest() = n <b>match</b> {
 *     <b>case</b> "myTest1" => assertTrue(<b>true</b>)
 *     <b>case</b> "myTest2" => assertTrue("hello", <b>false</b>)
 *   }
 * }
 *
 * <b>val</b> r = <b>new</b> TestResult()
 * suite.run(r)
 * <b>for</b> (tf &lt;- r.failures()) {
 *   println(tf.toString())
 * }
 * </pre>
 * <p>
 *   The trait <code>TestConsoleMain</code> contains this code as
 *   a <code>main</code> method, for convenience.
 * </p>
 *
 * @deprecated SUnit will be removed in 2.8.0. There are several free and
 * sophisticated testing frameworks for Scala available, examples are
 * "ScalaTest", "ScalaCheck" or "Specs".
 *
 * @author <NAME>
 */
@deprecated
object SUnit {

  /** <p>
   *    Convenience trait, mix it in a <code>TestMain</code> object and
   *    implement "suite" to get this code.
   *  </p><pre>
   *  <b>val</b> r = <b>new</b> TestResult()
   *  suite.run(r)
   *  <b>for</b> (<b>val</b> tf &lt;- r.failures()) {
   *    println(tf.toString())
   *  </pre>
   */
  trait TestConsoleMain {
    def suite: TestSuite
    def main(args: Array[String]) {
      val r = new TestResult()
      suite.run(r)
      for (tf <- r.failures())
        println(tf.toString())
    }
  }

  /** a Test can be run with its result being collected */
  trait Test {
    def run(r: TestResult): Unit
  }

{'fraction_non_alphanumeric': 0.18762839534352888, 'fraction_numerical': 0.005249942935402876, 'mean_word_length': 1.5883047844063791, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2872798', 'n_tokens_mistral': 1548, 'n_tokens_neox': 1518, 'n_words': 316}