<commit_before>( function _Typing_test_s_( ) {

'use strict';

if( typeof module !== 'undefined' )
{

  try
  {
    require( '../../abase/wTools.s' );
  }
  catch( err )
  {
    require( 'wTools' );
  }

  var _ = wTools;

  _.include( 'wTesting' );

}

var _ = wTools;

//

function objectLike( t )
{
  debugger;

  t.description = 'array-like entities should not overlap with array-like entities set';

  t.identical( _.objectLike( new ArrayBuffer( 10 ) ),false );
  t.identical( _.objectLike( new Float32Array( 10 ) ),false );
  t.identical( _.objectLike( new Int32Array( 10 ) ),false );
  t.identical( _.objectLike( new DataView( new ArrayBuffer( 10 ) ) ),false );
  t.identical( _.objectLike( new Array( 10 ) ),false );
  t.identical( _.objectLike( [ 1,2,3 ] ),false );
  t.identical( _.objectLike( new Map ),false );

  t.description = 'this entities are object-like';

  t.identical( _.objectLike( new Object() ),true );
  t.identical( _.objectLike( {} ),true );
  t.identical( _.objectLike( Object.create( null ) ),true );

  debugger;
}

//

var Self =
{

  name : 'wTools.Typing',
  silencing : 1,
  // verbosity : 9,

  tests :
  {

    objectLike : objectLike,

  }

}

//

Self = wTestSuite( Self );
if( typeof module !== 'undefined' && !module.parent )
_.Tester.test( Self.name );
<commit_msg>add promiseIs, consequenceLike test<commit_after>( function _Typing_test_s_( ) {

'use strict';

if( typeof module !== 'undefined' )
{

  try
  {
    require( '../../abase/wTools.s' );
  }
  catch( err )
  {
    require( 'wTools' );
  }

  var _ = wTools;

  _.include( 'wTesting' );

}

var _ = wTools;

//

function objectLike( t )
{
  debugger;

  t.description = 'array-like entities should not overlap with array-like entities set';

  t.identical( _.objectLike( new ArrayBuffer( 10 ) ),false );
  t.identical( _.objectLike( new Float32Array( 10 ) ),false );
  t.identical( _.objectLike( new Int32Array( 10 ) ),false );
  t.identical( _.objectLike( new DataView( new ArrayBuffer( 10 ) ) ),false );
  t.identical( _.objectLike( new Array( 10 ) ),false );
  t.identical( _.objectLike( [ 1,2,3 ] ),false );
  t.identical( _.objectLike( new Map ),false );

  t.description = 'this entities are object-like';

  t.identical( _.objectLike( new Object() ),true );
  t.identical( _.objectLike( {} ),true );
  t.identical( _.objectLike( Object.create( null ) ),true );

  debugger;
}

//

function promiseIs( test )
{
  test.description = 'check if entity is a Promise';

  test.shouldBe( !_.promiseIs() );
  test.shouldBe( !_.promiseIs( {} ) );

  var _Promise = function Promise(){};
  test.shouldBe( !_.promiseIs( new _Promise() ) );

  test.shouldBe( _.promiseIs( Promise.resolve( 0 ) ) );

  var promise = new Promise( ( resolve, reject ) => { resolve( 0 ) } )
  test.shouldBe( _.promiseIs( promise ) );
}

//

function consequenceLike( test )
{
  test.description = 'check if entity is a consequenceLike';

  test.shouldBe( !_.consequenceLike() );
  test.shouldBe( !_.consequenceLike( {} ) );
  test.shouldBe( _.consequenceLike( new wConsequence() ) );
  test.shouldBe( _.consequenceLike( wConsequence() ) );
  test.shouldBe( _.consequenceLike( Promise.resolve( 0 ) ) );

  var promise = new Promise( ( resolve, reject ) => { resolve( 0 ) } )
  test.shouldBe( _.consequenceLike( promise ) );
  test.shouldBe( _.consequenceLike( wConsequence.from( promise ) ) );
}

//

var Self =
{

  name : 'wTools.Typing',
  silencing : 1,
  // verbosity : 9,

  tests :
  {

    objectLike : objectLike,

    promiseIs : promiseIs,
    consequenceLike : consequenceLike

  }

}

//

Self = wTestSuite( Self );
if( typeof module !== 'undefined' && !module.parent )
_.Tester.test( Self.name );

{'fraction_non_alphanumeric': 0.1643167028199566, 'fraction_numerical': 0.0113882863340564, 'mean_word_length': 3.2647398843930637, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4133043', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1268, 'n_words': 318}