<commit_before>package asx.fn
{
	import flash.events.EventDispatcher;
	import flash.events.EventDispatcher;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.utils.getTimer;
	import flash.utils.Timer;

	import org.flexunit.async.Async;
	import org.flexunit.assertThat;
	import org.hamcrest.object.equalTo;
	import org.hamcrest.object.isFalse;
	import org.hamcrest.number.greaterThan;

	public class DebounceTest
	{
		[Test(async)]
		public function invokes_the_original_function_after_debounced_function_stops_being_called_for_wait_milliseconds():void 
		{
			var dispatcher:EventDispatcher = new EventDispatcher();
			Async.proceedOnEvent(this, dispatcher, Event.COMPLETE, 1000);

			var start:int = getTimer();
			var complete:Function = function():void { 
				assertThat(getTimer() - start, greaterThan(700));
				dispatcher.dispatchEvent(new Event(Event.COMPLETE));
			};

			var timer:Timer = new Timer(50, 8);
			timer.addEventListener(TimerEvent.TIMER, debounce(complete, 300));
			timer.start();
		}
	}
}<commit_msg>increase DebounceTest timeout due to imprecision of flash.utils.Timer<commit_after>package asx.fn
{
	import flash.events.EventDispatcher;
	import flash.events.EventDispatcher;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.utils.getTimer;
	import flash.utils.Timer;

	import org.flexunit.async.Async;
	import org.flexunit.assertThat;
	import org.hamcrest.object.equalTo;
	import org.hamcrest.object.isFalse;
	import org.hamcrest.number.greaterThan;

	public class DebounceTest
	{
		[Test(async)]
		public function invokes_the_original_function_after_debounced_function_stops_being_called_for_wait_milliseconds():void 
		{
			var dispatcher:EventDispatcher = new EventDispatcher();
			Async.proceedOnEvent(this, dispatcher, Event.COMPLETE, 1500);

			var start:int = getTimer();
			var complete:Function = function():void { 
				assertThat(getTimer() - start, greaterThan(700));
				dispatcher.dispatchEvent(new Event(Event.COMPLETE));
			};

			var timer:Timer = new Timer(50, 8);
			timer.addEventListener(TimerEvent.TIMER, debounce(complete, 300));
			timer.start();
		}
	}
}
{'fraction_non_alphanumeric': 0.10770659238625813, 'fraction_numerical': 0.012070566388115135, 'mean_word_length': 5.3011695906432745, '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': '2345875', 'n_tokens_mistral': 778, 'n_tokens_neox': 681, 'n_words': 125}