| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
| 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.md file. | |
| 4 | |
| 5 library fasta.scanner.testing.scanner_chain; | |
| 6 | |
| 7 import 'package:testing/testing.dart'; | |
| 8 | |
| 9 import '../../scanner.dart'; | |
| 10 | |
| 11 import '../io.dart'; | |
| 12 | |
| 13 class Read extends Step<TestDescription, List<int>, ChainContext> { | |
| 14 const Read(); | |
| 15 | |
| 16 String get name => "read"; | |
| 17 | |
| 18 Future<Result<List<int>>> run( | |
| 19 TestDescription input, ChainContext context) async { | |
| 20 return pass(await readBytesFromFile(input.uri)); | |
| 21 } | |
| 22 } | |
| 23 | |
| 24 class Scan extends Step<List<int>, ScannerResult, ChainContext> { | |
| 25 const Scan(); | |
| 26 | |
| 27 String get name => "scan"; | |
| 28 | |
| 29 Future<Result<ScannerResult>> run( | |
| 30 List<int> bytes, ChainContext context) async { | |
| 31 return pass(scan(bytes)); | |
| 32 } | |
| 33 } | |
| OLD | NEW |