Skip to content

Commit 69b801e

Browse files
committed
cleanup(test): sync test generators return String (not Future<String>)
1 parent a6e2184 commit 69b801e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

source_gen/test/builder_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,14 @@ class _LiteralGenerator extends Generator {
265265
const _LiteralGenerator([this._content]);
266266

267267
@override
268-
FutureOr<String> generate(_, __) => _content;
268+
String generate(_, __) => _content;
269269
}
270270

271271
class _BadOutputGenerator extends Generator {
272272
const _BadOutputGenerator();
273273

274274
@override
275-
Future<String> generate(LibraryReader library, _) async => 'not valid code!';
275+
String generate(_, __) => 'not valid code!';
276276
}
277277

278278
final _customHeader = '// Copyright 1979';

source_gen/test/src/unformatted_code_generator.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'dart:async';
6-
75
import 'package:source_gen/source_gen.dart';
86

97
/// Generates a single-line of unformatted code.
108
class UnformattedCodeGenerator extends Generator {
119
const UnformattedCodeGenerator();
1210

1311
@override
14-
Future<String> generate(LibraryReader library, _) async => unformattedCode;
12+
String generate(_, __) => unformattedCode;
1513

1614
static const formattedCode = '''
1715
void hello() => print('hello');

0 commit comments

Comments
 (0)