| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library fuzz_support; | 5 library fuzz_support; |
| 6 | 6 |
| 7 import 'package:expect/expect.dart'; |
| 7 import 'dart:async'; | 8 import 'dart:async'; |
| 8 import 'dart:io'; | 9 import 'dart:io'; |
| 9 | 10 |
| 10 const typeMapping = const { | 11 const typeMapping = const { |
| 11 'null': null, | 12 'null': null, |
| 12 'int': 0, | 13 'int': 0, |
| 13 'bigint': 18446744073709551617, | 14 'bigint': 18446744073709551617, |
| 14 'String': 'a', | 15 'String': 'a', |
| 15 'FileMode': FileMode.READ, | 16 'FileMode': FileMode.READ, |
| 16 'num': 0.50, | 17 'num': 0.50, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 44 try { f(); } catch (e) {} | 45 try { f(); } catch (e) {} |
| 45 } | 46 } |
| 46 | 47 |
| 47 // Perform async operation and transform the future for the operation | 48 // Perform async operation and transform the future for the operation |
| 48 // into a future that never fails by treating errors as normal | 49 // into a future that never fails by treating errors as normal |
| 49 // completion. | 50 // completion. |
| 50 Future doItAsync(void f()) { | 51 Future doItAsync(void f()) { |
| 51 // Ignore value and errors. | 52 // Ignore value and errors. |
| 52 return new Future.delayed(0, f).catchError((_) {}).then((_) => true); | 53 return new Future.delayed(0, f).catchError((_) {}).then((_) => true); |
| 53 } | 54 } |
| OLD | NEW |