From 5f6b7a5b3559522befde13125fddf128019bdb80 Mon Sep 17 00:00:00 2001 From: Chris Buckett Date: Sat, 22 Feb 2014 14:36:07 +0000 Subject: [PATCH 1/2] Correct async testing Now the test won't finish until the async code has finished executing --- test/dartminer.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/dartminer.dart b/test/dartminer.dart index b587bca..186d773 100644 --- a/test/dartminer.dart +++ b/test/dartminer.dart @@ -7,7 +7,7 @@ void main() { test('Test Mining', () { // Get the work. - getJSON('getwork.json').then((dynamic work) { + getJSON('getwork.json').then(expectAsync(dynamic work) { // Create the miner. Miner miner = new Miner(work); @@ -21,6 +21,6 @@ void main() { // Print the result. print(result); expect(result, '01000000378da709d01338204d85458bcd0f4751dfd688b56e94beab7e20ad920000000002aea838751547f70c0d12aa880ca185ad98136af5ad1f8220374c128577b60c8703064ef8ff071d352e9531800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000280'); - }); + })); }); } From 4981eadf02e35ef2f23021f773950226de063115 Mon Sep 17 00:00:00 2001 From: Chris Buckett Date: Sat, 22 Feb 2014 14:49:30 +0000 Subject: [PATCH 2/2] Update dartminer.dart --- test/dartminer.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dartminer.dart b/test/dartminer.dart index 186d773..6d28817 100644 --- a/test/dartminer.dart +++ b/test/dartminer.dart @@ -7,7 +7,7 @@ void main() { test('Test Mining', () { // Get the work. - getJSON('getwork.json').then(expectAsync(dynamic work) { + getJSON('getwork.json').then(expectAsync((dynamic work) { // Create the miner. Miner miner = new Miner(work);