<commit_before>var jsCurrentTestFunction;

var JsTestFunction = new Class({
   Extends : JsTestCase,
   
   options : {
      functionNamePrefix : "",
      setUpFunctionName : "setUp",
      tearDownFunctionName : "tearDown"
   },
   
   //Constructor
   initialize : function( name, options ) {
      this.parent( name, options );
      this.listeners = new Array();
      this.setUpFunction;
      this.status = 'ready';
      this.tearDownFunction;
      this.testFunction;
      this.traceMessages = new Array();
   },

   //Public accessor and mutator methods
   addTraceMessage : function( traceMessage ) {
      this.traceMessages.include( traceMessage );
   },

   listen : function( callback ) {
      this.listeners.include( callback );
   },

   notify : function( event ) {
      for( var i = 0; i < this.listeners.length; i++ ){
         this.listeners[i].call( null, this, event );
      }
   },
   
   run : function(){
      this.testFunction = eval( this.options.functionNamePrefix + this.name );
      
      try{ this.setUpFunction = eval( this.options.functionNamePrefix + this.options.setUpFunctionName );
      }catch( e ){}
      
      try{ this.tearDownFunction = eval( this.options.functionNamePrefix + this.options.tearDownFunctionName );
      }catch( e ){}
      
      this.parent();
   },
   
   //Properties
   
   //Protected, private helper methods
   callAfterEachTest: function(){
      if( this.tearDownFunction ) this.tearDownFunction();
      this.parent();
   }.protect(),
   
   callBeforeEachTest: function(){
      if( this.setUpFunction ) this.setUpFunction();
      this.parent();
   }.protect(),
   
   notifyOnTestCaseStart : function(){
      eval( this.options.functionNamePrefix + "JsTestFunction.current = this" );
      eval( this.options.functionNamePrefix + "JsTestFunction.current.onReady = this.onRunTestFinished" );
      this.parent();
   }.protect(),
   
   runTest: function(){
      this.testFunction();
   }.protect()
});<commit_msg>Derive fake test class name from the test page url.<commit_after>var jsCurrentTestFunction;

var JsTestFunction = new Class({
   Extends : JsTestCase,
   
   options : {
      functionNamePrefix : "",
      setUpFunctionName : "setUp",
      tearDownFunctionName : "tearDown"
   },
   
   //Constructor
   initialize : function( name, options ) {
      this.parent( name, options );
      this.fakeClassName;
      this.listeners = new Array();
      this.setUpFunction;
      this.status = 'ready';
      this.tearDownFunction;
      this.testFunction;
      this.traceMessages = new Array();
      this.deriveFakeClassNameFromUrl();
   },

   //Public accessor and mutator methods
   addTraceMessage : function( traceMessage ) {
      this.traceMessages.include( traceMessage );
   },

   listen : function( callback ) {
      this.listeners.include( callback );
   },

   notify : function( event ) {
      for( var i = 0; i < this.listeners.length; i++ ){
         this.listeners[i].call( null, this, event );
      }
   },
   
   run : function(){
      this.testFunction = eval( this.options.functionNamePrefix + this.name );
      
      try{ this.setUpFunction = eval( this.options.functionNamePrefix + this.options.setUpFunctionName );
      }catch( e ){}
      
      try{ this.tearDownFunction = eval( this.options.functionNamePrefix + this.options.tearDownFunctionName );
      }catch( e ){}
      
      this.parent();
   },
   
   //Properties
   getFullName : function() { return this.options.url ? this.options.url.toLowerCase() + ":" + this.fakeClassName + "." + this.name : this.name; },
   
   //Protected, private helper methods
   callAfterEachTest: function(){
      if( this.tearDownFunction ) this.tearDownFunction();
      this.parent();
   }.protect(),
   
   callBeforeEachTest: function(){
      if( this.setUpFunction ) this.setUpFunction();
      this.parent();
   }.protect(),
   
   deriveFakeClassNameFromUrl: function(){
      this.fakeClassName = this.options.url.substring( this.options.url.lastIndexOf( "/" ) +1, this.options.url.indexOf( ".htm" ));
   }.protect(),
   
   notifyOnTestCaseStart : function(){
      eval( this.options.functionNamePrefix + "JsTestFunction.current = this" );
      eval( this.options.functionNamePrefix + "JsTestFunction.current.onReady = this.onRunTestFinished" );
      this.parent();
   }.protect(),
   
   runTest: function(){
      this.testFunction();
   }.protect()
});
{'fraction_non_alphanumeric': 0.1313063063063063, 'fraction_numerical': 0.0006756756756756757, 'mean_word_length': 2.7445193929173692, 'pattern_counts': {'":': 1, '<': 5, '<?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': '1794735', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1300, 'n_words': 264}