<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses(
    'unittest.TestCase',
    'unittest.AssertionFailedError'
  );

  /**
   * TestCase
   *
   * @see   xp://unittest.AssertionFailedError
   */
  class AssertionMessagesTest extends TestCase {
  
    /**
     * Assertion helper
     *
     * @param   string expected
     * @param   unittest.AssertionFailedError error
     * @throws  unittest.AssertionFailedError
     */
    protected function assertMessageEquals($expected, $error) {
      $this->assertEquals(
        "unittest.AssertionFailedError ".$expected."\n",
        $error->compoundMessage()
      );
    }

    /**
     * Test
     *
     */
    #[@test]
    public function differentPrimitives() {
      $this->assertMessageEquals(
        '(==) { expected: [integer:2] but was: [integer:1] }',
        new AssertionFailedError('==', 1, 2)
      );
    }

    /**
     * Test
     *
     */
    #[@test]
    public function differentStrings() {
      $this->assertMessageEquals(
        '(equals) { expected: [lang.types.String:] but was: [lang.types.String:abc] }',
        new AssertionFailedError('equals', new String('abc'), new String(''))
      );
    }

    /**
     * Test
     *
     */
    #[@test]
    public function stringAndStringPrimitive() {
      $this->assertMessageEquals(
        '(equals) { expected: [lang.types.String:] but was: [string:""] }',
        new AssertionFailedError('equals', '', new String(''))
      );<commit_msg>- Add differentPrimitives() test<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses(
    'unittest.TestCase',
    'unittest.AssertionFailedError'
  );

  /**
   * TestCase
   *
   * @see   xp://unittest.AssertionFailedError
   */
  class AssertionMessagesTest extends TestCase {
  
    /**
     * Assertion helper
     *
     * @param   string expected
     * @param   unittest.AssertionFailedError error
     * @throws  unittest.AssertionFailedError
     */
    protected function assertMessageEquals($expected, $error) {
      $this->assertEquals(
        "unittest.AssertionFailedError ".$expected."\n",
        $error->compoundMessage()
      );
    }

    /**
     * Test
     *
     */
    #[@test]
    public function differentIntegerPrimitives() {
      $this->assertMessageEquals(
        '(==) { expected: [integer:2] but was: [integer:1] }',
        new AssertionFailedError('==', 1, 2)
      );
    }

    /**
     * Test
     *
     */
    #[@test]
    public function differentPrimitives() {
      $this->assertMessageEquals(
        '(==) { expected: [integer:2] but was: [double:2] }',
        new AssertionFailedError('==', 2.0, 2)
      );
    }

    /**
     * Test
     *
     */
    #[@test]
    public function differentStrings() {
      $this->assertMessageEquals(
        '(equals) { expected: [lang.types.String:] but was: [lang.types.String:abc] }',
        new AssertionFailedError('equals', new String('abc'), new String(''))
      );
    }

    /**
     * Test
     *
     */
    #[@test]
    public function stringAndStringPrimitive() {
      $this->assertMessageEquals(
        '(equals) { expected: [lang.types.String:] but was: [string:""] }',
        new AssertionFailedError('equals', '', new String(''))
      );
{'fraction_non_alphanumeric': 0.1557651353818071, 'fraction_numerical': 0.003954974140553696, 'mean_word_length': 2.2490118577075098, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '3876197', 'n_tokens_mistral': 1026, 'n_tokens_neox': 990, 'n_words': 192}