<commit_before><?php

class TestTimberGettext extends Timber_UnitTestCase {

	function test__() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ __('my_boo') }}", $context);
		$this->assertEquals(__('my_boo'), trim($str));
	}

	function testTranslate() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ translate('my_boo') }}", $context);
		$this->assertEquals(translate('my_boo'), trim($str));
	}
  
	function test_e() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _e('my_boo') }}", $context);
		$this->assertEquals(_e('my_boo'), trim($str));
	}
  
	function test_n() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _n('foo', 'foos', 1 ) }}", $context);
		$this->assertEquals(_n('foo', 'foos', 1 ), trim($str));
		$str = Timber::compile_string("{{ _n('foo', 'foos', 2 ) }}", $context);
		$this->assertEquals(_n('foo', 'foos', 2 ), trim($str));
	}

	function test_x() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _x('boo', 'my') }}", $context);
		$this->assertEquals(_x('boo', 'my'), trim($str));
	}
  
	function test_ex() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _ex('boo', 'my') }}", $context);
		$this->assertEquals(_ex('boo', 'my'), trim($str));
	}

	function test_nx() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _nx('boo', 'boos', 1, 'my' ) }}", $context);
		$this->assertEquals(_nx('boo', 'boos', 1, 'my' ), trim($str));
		$str = Timber::compile_string("{{ _nx('boo', 'boos', 2, 'my' ) }}", $context);
		$this->assertEquals(_nx('boo', 'boos', 2, 'my' ), trim($str));
	}
    <commit_msg>Fix bug in _e function tests<commit_after><?php

class TestTimberGettext extends Timber_UnitTestCase {

	function test__() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ __('my_boo') }}", $context);
		$this->assertEquals(__('my_boo'), trim($str));
	}

	function testTranslate() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ translate('my_boo') }}", $context);
		$this->assertEquals(translate('my_boo'), trim($str));
	}
  
	function test_e() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _e('my_boo') }}", $context);
    ob_start(); 
    _e('my_boo');
    $_e = ob_get_clean();
		$this->assertEquals($_e, trim($str));
	}
  
	function test_n() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _n('foo', 'foos', 1 ) }}", $context);
		$this->assertEquals(_n('foo', 'foos', 1 ), trim($str));
		$str = Timber::compile_string("{{ _n('foo', 'foos', 2 ) }}", $context);
		$this->assertEquals(_n('foo', 'foos', 2 ), trim($str));
	}

	function test_x() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _x('boo', 'my') }}", $context);
		$this->assertEquals(_x('boo', 'my'), trim($str));
	}
  
	function test_ex() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _ex('boo', 'my') }}", $context);
    ob_start(); 
    _ex('boo', 'my');
    $_ex = ob_get_clean();
		$this->assertEquals($_ex, trim($str));
	}

	function test_nx() {
		$context = Timber::get_context();
		$str = Timber::compile_string("{{ _nx('boo', 'boos', 1, 'my' ) }}", $context);
		$this->assertEquals(_nx('boo', 'boos', 1, 'my' ), trim($str));
		$str = Timber::compile_string("{{ _nx('boo', 'boos', 2, 'my' ) }}", $context);
		$this->assertEquals(_nx('boo', 'boos', 2, 'my' ), trim($str));
	}
    
{'fraction_non_alphanumeric': 0.255075779239348, 'fraction_numerical': 0.004575350300257364, 'mean_word_length': 5.453874538745388, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '4414684', 'n_tokens_mistral': 1393, 'n_tokens_neox': 1318, 'n_words': 235}