<commit_before><html>
<head>
<link href="qunit/qunit.css" rel="stylesheet" type="text/css" />
<head>
<body>

<h1 id="qunit-header"><a href="https://github.com/jeremyckahn/shifty">Shifty</a></h1>
 <h2 id="qunit-banner"></h2>
 <div id="qunit-testrunner-toolbar"></div>
 <h2 id="qunit-userAgent"></h2>
 <ol id="qunit-tests"></ol>
 <div id="qunit-fixture"></div>
<script src="qunit/qunit.js"></script>
<script src="utils/require.js"></script>
<script src="utils/loadlist.js"></script>

<script>
require.ready(function () {

  var quickTestDuration
      ,QUICK_TEST_DURATION = 250
      ,START_TEST_VAL = 0
      ,END_TEST_VAL = 10;

  function simpleTestTween (inst, step, callback) {
    inst.tween({
      'from': {
        'testVal': START_TEST_VAL
      }
      ,'to': {
        'testVal': END_TEST_VAL
      }
      ,'duration': QUICK_TEST_DURATION
      ,'step': step 
      ,'callback': callback
    });
  }

  quickTestDuration = 250
  module('Basic smoke tests');

  test('Generate a series of consecutively larger numbers.', function () {
    var myTweenable
        ,generatedVals
        ,lastGeneratedVal
        ,valsAreInOrder;
   
    stop();
    myTweenable = new Tweenable();
    generatedVals = [];
    lastGeneratedVal = 0;
    valsAreInOrder = true;
      
    simpleTestTween(
      myTweenable
      ,function step () {
        
        if (this.testVal >= lastGeneratedVal
          && valsAreInOrder === true) {
          
          // we're good!
        } else {
          // we're bad!  :(
          valsAreInOrder = false;
        }
        lastGeneratedVal = this.testVal;
      }, function callback () {

        ok(valsAreInOrder, 'Values were generated in order.');
        equal(this.testVal, END_TEST_VAL, 'Final generated value equals the target value.');
        start();
      });
  });


  test('<code>.get</code> method gets an instance\'s current values.', 2, function () {
    var myTweenable
        ,retrievedVal;
    
    myTweenable = new Tweenable(); 
    stop();

    simpleTestTween(
      myTweenable
      ,function step () {
        retrievedVal = myTweenable.get().testVal;
      }, function callback () {
        equal(typeof retrievedVal, 'number', 'Sampled value is a number.');
        equal(myTweenable.get().testVal, END_TEST_VAL, 'Final retrieved value equals the target value.');
        start();
      });
  });

  test('<code>.pause</code> temporarily stops the animation calculation.', function () {
    var myTweenable
        ,testValRightBeforePause
        ,testValRightBeforeResume
        ,stepCallCount
        ,startTimestamp
        ,endTimestamp
        ,pauseTime;
    
    function step () { 
      if (stepCallCount === 2) {
        testValRightBeforePause = myTweenable.get().testVal;
        myTweenable.pause();
          
        setTimeout(function () {
          testValRightBeforeResume = myTweenable.get().testVal;
          myTweenable.resume();
        }, pauseTime);
      }

      stepCallCount++;
    }
    
    stop();
    stepCallCount = 0;
    pauseTime = 500;
    myTweenable = new Tweenable();
    startTimestamp = Tweenable.util.now();
    
    simpleTestTween(
      myTweenable
      ,step
      ,function callback () {
        endTimestamp = Tweenable.util.now();

        equal(testValRightBeforePause, testValRightBeforeResume, 'Test value did not change in the time it was changed and the time that the tween was `pause`d and when it was `resume`d.');
        ok( (endTimestamp - startTimestamp) >= (QUICK_TEST_DURATION + pauseTime), 'The duration of the pause is added to the actual duration of the tween.' );
        start(); 
      }
    );
  });

});

</script>
</body>
</html><commit_msg>Added another passing pause test.<commit_after><html>
<head>
<link href="qunit/qunit.css" rel="stylesheet" type="text/css" />
<head>
<body>

<h1 id="qunit-header"><a href="https://github.com/jeremyckahn/shifty">Shifty</a></h1>
 <h2 id="qunit-banner"></h2>
 <div id="qunit-testrunner-toolbar"></div>
 <h2 id="qunit-userAgent"></h2>
 <ol id="qunit-tests"></ol>
 <div id="qunit-fixture"></div>
<script src="qunit/qunit.js"></script>
<script src="utils/require.js"></script>
<script src="utils/loadlist.js"></script>

<script>
require.ready(function () {

  var quickTestDuration
      ,QUICK_TEST_DURATION = 250
      ,START_TEST_VAL = 0
      ,END_TEST_VAL = 10;

  function simpleTestTween (inst, step, callback) {
    inst.tween({
      'from': {
        'testVal': START_TEST_VAL
      }
      ,'to': {
        'testVal': END_TEST_VAL
      }
      ,'duration': QUICK_TEST_DURATION
      ,'step': step 
      ,'callback': callback
    });
  }

  quickTestDuration = 250
  module('Basic smoke tests');

  test('Generate a series of consecutively larger numbers.', function () {
    var myTweenable
        ,generatedVals
        ,lastGeneratedVal
        ,valsAreInOrder;
   
    stop();
    myTweenable = new Tweenable();
    generatedVals = [];
    lastGeneratedVal = 0;
    valsAreInOrder = true;
      
    simpleTestTween(
      myTweenable
      ,function step () {
        
        if (this.testVal >= lastGeneratedVal
          && valsAreInOrder === true) {
          
          // we're good!
        } else {
          // we're bad!  :(
          valsAreInOrder = false;
        }
        lastGeneratedVal = this.testVal;
      }, function callback () {

        ok(valsAreInOrder, 'Values were generated in order.');
        equal(this.testVal, END_TEST_VAL, 'Final generated value equals the target value.');
        start();
      });
  });


  test('<code>.get</code> method gets an instance\'s current values.', 2, function () {
    var myTweenable
        ,retrievedVal;
    
    myTweenable = new Tweenable(); 
    stop();

    simpleTestTween(
      myTweenable
      ,function step () {
        retrievedVal = myTweenable.get().testVal;
      }, function callback () {
        equal(typeof retrievedVal, 'number', 'Sampled value is a number.');
        equal(myTweenable.get().testVal, END_TEST_VAL, 'Final retrieved value equals the target value.');
        start();
      });
  });

  test('<code>.pause</code> temporarily stops the animation calculation.', function () {
    var myTweenable
        ,testValRightBeforePause
        ,testValRightBeforeResume
        ,stepCallCount
        ,startTimestamp
        ,endTimestamp
        ,pauseTime
        ,previousTestVal
        ,deltaSum;
    
    function step () { 
      if (stepCallCount === 2) {
        testValRightBeforePause = myTweenable.get().testVal;
        myTweenable.pause();
          
        setTimeout(function () {
          testValRightBeforeResume = myTweenable.get().testVal;
          myTweenable.resume();
        }, pauseTime);
      }

      stepCallCount++;
      deltaSum += (myTweenable.get().testVal - previousTestVal);
      previousTestVal = myTweenable.get().testVal;
    }
    
    stop();
    stepCallCount = 0;
    pauseTime = 500;
    deltaSum = 0;
    previousTestVal = START_TEST_VAL;
    myTweenable = new Tweenable();
    startTimestamp = Tweenable.util.now();
    
    simpleTestTween(
      myTweenable
      ,step
      ,function callback () {
        endTimestamp = Tweenable.util.now();
        equal(testValRightBeforePause, testValRightBeforeResume, 'Test value did not change in the time it was changed and the time that the tween was `pause`d and when it was `resume`d.');
        ok( (endTimestamp - startTimestamp) >= (QUICK_TEST_DURATION + pauseTime), 'The duration of the pause is added to the actual duration of the tween.' );
        ok( Math.abs((END_TEST_VAL - START_TEST_VAL) - deltaSum) < 1, 'Total step deltas were within 1.0 of the target amount.' );
        start(); 
      }
    );
  });

});

</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.131500838817912, 'fraction_numerical': 0.006194347657762292, 'mean_word_length': 2.4847122302158273, 'pattern_counts': {'":': 0, '<': 70, '<?xml version=': 0, '>': 73, 'https://': 2, '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': '1498950', 'n_tokens_mistral': 2462, 'n_tokens_neox': 2385, 'n_words': 539}