<commit_before>( function _SystemDefaultHardDrive_test_ss_()
{

'use strict';

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

  require( './aFileProviderSystemDefault.test.s' );

}

//

let _ = _global_.wTools;
let Parent = wTests[ 'Tools.mid.files.fileProvider.system.default.Abstract' ];

_.assert( !!Parent );

// --
// context
// --

function onSuiteBegin()
{
  var context = this;

  context.suiteTempPath = _.path.tempOpen( _.path.join( __dirname, '../..'  ), 'System/HardDrive' );

  context.providerEffective = _.FileProvider.HardDrive();

  context.provider = _.FileProvider.System({ empty : 1 });
  context.provider.providerRegister( context.providerEffective );
  context.provider.defaultProvider = context.providerEffective;
  context.globalFromPreferred =
  _.routineJoin( context.providerEffective.path, context.providerEffective.path.globalFromPreferred );
  context.provider.UsingBigIntForStat = context.providerEffective.UsingBigIntForStat;

}

//

function onSuiteEnd()
{
  let context = this;
  context.providerEffective.finit();
  context.provider.finit();
  _.assert( _.strHas( this.suiteTempPath, '.tmp' ), this.suiteTempPath );
  // this.providerEffective.filesDelete({ filePath : this.suiteTempPath });
  _.path.tempClose( this.suiteTempPath );
}

//

function onRoutineEnd( test )
{
  let context = this;
  let system = context.system || context.provider;
  _.sure( system instanceof _.FileProvider.System );
  _.sure( _.entityIdentical( _.mapKeys( system.providersWithProtocolMap ), [ 'file', 'hd' ] ), test.name, 'has not restored system!' );
}

//

function pathFor( filePath )
{
  var context = this;

  filePath =  _.path.join( context.suiteTempPath,  filePath );

  return context.providerEffective.originPath + _.path.normalize( filePath );
}

//

function providerMake()
{
  let context = this;

  let system = _.FileProvider.System({ empty : 1 });

  let provider = _.FileProvider.HardDrive
  ({
    protocols : [ 'current', 'second' ],
  });

  system.providerRegister( provider );

  system.defaultProvider = provider;

  return system;
}

// --
// declare
// --

var Proto =
{

  name : 'Tools.mid.files.fileProvider.system.default.HardDrive',
  abstract : 0,
  silencing : 1,
  enabled : 1,

  onSuiteBegin,
  onSuiteEnd,
  onRoutineEnd,

  context :
  {
    pathFor,
    providerMake,
    provider : null,
    providerEffective : null,
    suiteTempPath : null,
    globalFromPreferred : null,
  },

  tests :
  {
  },

}

//

let Self = new wTestSuite( Proto ).inherit( Parent );
if( typeof module !== 'undefined' && !module.parent )
wTester.test( Self.name );

} )( );
<commit_msg>Change protocols to standard in file `SystemDefaultHardDrive.test.s`<commit_after>( function _SystemDefaultHardDrive_test_ss_()
{

'use strict';

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

  require( './aFileProviderSystemDefault.test.s' );

}

//

let _ = _global_.wTools;
let Parent = wTests[ 'Tools.mid.files.fileProvider.system.default.Abstract' ];

_.assert( !!Parent );

// --
// context
// --

function onSuiteBegin()
{
  var context = this;

  context.suiteTempPath = _.path.tempOpen( _.path.join( __dirname, '../..'  ), 'System/HardDrive' );

  context.providerEffective = _.FileProvider.HardDrive();

  context.provider = _.FileProvider.System({ empty : 1 });
  context.provider.providerRegister( context.providerEffective );
  context.provider.defaultProvider = context.providerEffective;
  context.globalFromPreferred =
  _.routineJoin( context.providerEffective.path, context.providerEffective.path.globalFromPreferred );
  context.provider.UsingBigIntForStat = context.providerEffective.UsingBigIntForStat;

}

//

function onSuiteEnd()
{
  let context = this;
  context.providerEffective.finit();
  context.provider.finit();
  _.assert( _.strHas( this.suiteTempPath, '.tmp' ), this.suiteTempPath );
  // this.providerEffective.filesDelete({ filePath : this.suiteTempPath });
  _.path.tempClose( this.suiteTempPath );
}

//

function onRoutineEnd( test )
{
  let context = this;
  let system = context.system || context.provider;
  _.sure( system instanceof _.FileProvider.System );
  _.sure( _.entityIdentical( _.mapKeys( system.providersWithProtocolMap ), [ 'file', 'hd' ] ), test.name, 'has not restored system!' );
}

//

function pathFor( filePath )
{
  var context = this;

  filePath =  _.path.join( context.suiteTempPath,  filePath );

  return context.providerEffective.originPath + _.path.normalize( filePath );
}

//

function providerMake()
{
  let context = this;

  let system = _.FileProvider.System({ empty : 1 });

  let provider = _.FileProvider.HardDrive
  ({
    protocols : [ 'file', 'hd' ],
    // protocols : [ 'current', 'second' ],
  });

  system.providerRegister( provider );

  system.defaultProvider = provider;

  return system;
}

// --
// declare
// --

var Proto =
{

  name : 'Tools.mid.files.fileProvider.system.default.HardDrive',
  abstract : 0,
  silencing : 1,
  enabled : 1,

  onSuiteBegin,
  onSuiteEnd,
  onRoutineEnd,

  context :
  {
    pathFor,
    providerMake,
    provider : null,
    providerEffective : null,
    suiteTempPath : null,
    globalFromPreferred : null,
  },

  tests :
  {
  },

}

//

let Self = new wTestSuite( Proto ).inherit( Parent );
if( typeof module !== 'undefined' && !module.parent )
wTester.test( Self.name );

} )( );

{'fraction_non_alphanumeric': 0.14417293233082706, 'fraction_numerical': 0.0018796992481203006, 'mean_word_length': 3.6512237762237763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1217184', 'n_tokens_mistral': 1744, 'n_tokens_neox': 1690, 'n_words': 337}