Skip to content

Commit

Permalink
cleanup(test): sync test generators return String (not Future<String>)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Jun 12, 2018
1 parent a6e2184 commit 69b801e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions source_gen/test/builder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ class _LiteralGenerator extends Generator {
const _LiteralGenerator([this._content]);

@override
FutureOr<String> generate(_, __) => _content;
String generate(_, __) => _content;
}

class _BadOutputGenerator extends Generator {
const _BadOutputGenerator();

@override
Future<String> generate(LibraryReader library, _) async => 'not valid code!';
String generate(_, __) => 'not valid code!';
}

final _customHeader = '// Copyright 1979';
Expand Down
4 changes: 1 addition & 3 deletions source_gen/test/src/unformatted_code_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';

import 'package:source_gen/source_gen.dart';

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

@override
Future<String> generate(LibraryReader library, _) async => unformattedCode;
String generate(_, __) => unformattedCode;

static const formattedCode = '''
void hello() => print('hello');
Expand Down

0 comments on commit 69b801e

Please sign in to comment.