Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: pkg/dart_scanner/lib/testing/scanner_chain.dart

Issue 2627093007: Update scanner so tests pass. (Closed)
Patch Set: Rebased on CL 2629543008. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/dart_scanner/lib/src/utf8_bytes_scanner.dart ('k') | pkg/dart_scanner/test/scanner.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library dart_scanner.testing.scanner_chain;
6
5 import 'package:testing/testing.dart'; 7 import 'package:testing/testing.dart';
6 8
7 import 'package:scanner/scanner.dart'; 9 import 'package:dart_scanner/scanner.dart';
8 10
9 import 'package:scanner/io.dart'; 11 import 'package:dart_scanner/io.dart';
10 12
11 class Read extends Step<TestDescription, List<int>, ChainContext> { 13 class Read extends Step<TestDescription, List<int>, ChainContext> {
12 const Read(); 14 const Read();
13 15
14 String get name => "read"; 16 String get name => "read";
15 17
16 Future<Result<List<int>>> run( 18 Future<Result<List<int>>> run(
17 TestDescription input, ChainContext context) async { 19 TestDescription input, ChainContext context) async {
18 return pass(await readBytesFromFile(input.uri)); 20 return pass(await readBytesFromFile(input.uri));
19 } 21 }
20 } 22 }
21 23
22 class Scan extends Step<List<int>, ScannerResult, ChainContext> { 24 class Scan extends Step<List<int>, ScannerResult, ChainContext> {
23 const Scan(); 25 const Scan();
24 26
25 String get name => "scan"; 27 String get name => "scan";
26 28
27 Future<Result<ScannerResult>> run( 29 Future<Result<ScannerResult>> run(
28 List<int> bytes, ChainContext context) async { 30 List<int> bytes, ChainContext context) async {
29 return pass(scan(bytes)); 31 return pass(scan(bytes));
30 } 32 }
31 } 33 }
OLDNEW
« no previous file with comments | « pkg/dart_scanner/lib/src/utf8_bytes_scanner.dart ('k') | pkg/dart_scanner/test/scanner.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698