Files
sdk/pkg/analyzer_cli/test/strong_mode_test.dart
T
Konstantin Shcheglov 9185294e7a Reland: Implement inheritance/override checks from the spec.
Relands https://dart-review.googlesource.com/c/sdk/+/76061
Was reverted in https://dart-review.googlesource.com/c/sdk/+/76301

The difference with the original CL is that we don't look into
superclass and mixins of mixed-in for concrete members. This reduces
the number of errors in Flutter codebase to 1.


R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: I86256b598d116439194cbaf4d09b4f72013d6563
Reviewed-on: https://dart-review.googlesource.com/76340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 18:51:04 +00:00

38 lines
1.2 KiB
Dart

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// 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.
library analyzer_cli.test.strong_mode;
import 'dart:io';
import 'package:analyzer_cli/src/driver.dart' show outSink;
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'driver_test.dart';
main() {
defineReflectiveTests(StrongModeTest);
}
/// End-to-end test for strong checking.
///
/// Most strong mode tests are in Analyzer, but this verifies the option is
/// working and producing extra errors as expected.
///
/// Generally we don't want a lot of cases here as it requires spinning up a
/// full analysis context.
@reflectiveTest
class StrongModeTest extends BaseTest {
test_producesStricterErrors() async {
await drive('data/strong_example.dart');
expect(exitCode, 3);
var stdout = bulletToDash(outSink);
expect(stdout, contains("isn't a valid override of"));
expect(stdout, contains('error - The list literal type'));
expect(stdout, contains('2 errors found'));
}
}