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

Side by Side Diff: tests/try/poi/forget_element_assertion.dart

Issue 2232273004: Delete site/try (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
(Empty)
1 // Copyright (c) 2014, 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 file.
4
5 // Tests that dart2js doesn't support metadata on local elements.
6 // Remove this file when dart2js support such features.
7 library trydart.forget_element_assertion;
8
9 import '../../compiler/dart2js/mock_compiler.dart' show
10 compilerFor;
11
12 import 'compiler_test_case.dart';
13
14 class FailingTestCase extends CompilerTestCase {
15 FailingTestCase.intermediate(String source, int errorCount, Uri scriptUri)
16 : super.init(
17 source, scriptUri,
18 compilerFor(source, scriptUri, expectedErrors: errorCount));
19
20 FailingTestCase(String source, int errorCount)
21 : this.intermediate(source, errorCount, customUri('main.dart'));
22
23 Future run() {
24 return compile().then((_) {
25 print("Failed as expected.");
26 }).catchError((error, stackTrace) {
27 print(
28 "\n\n\n***\n\n\n"
29 "The compiler didn't fail when compiling:\n $source\n\n"
30 "Please adjust assumptions in "
31 "tests/try/poi/forget_element_assertion.dart\n\n"
32 );
33 print("$error\n$stackTrace");
34 throw "Please update assumptions in this file.";
35 });
36 }
37 }
38
39 List<FailingTestCase> assertUnimplementedLocalMetadata() {
40 return <FailingTestCase>[
41
42 // This tests that the compiler doesn't accept metadata on local
43 // functions. If this feature is implemented, please convert this test to
44 // a positive test in forget_element_test.dart. For example:
45 //
46 // new ForgetElementTestCase(
47 // 'main() { @Constant() foo() {}; return foo(); } $CONSTANT_CLASS',
48 // metadataCount: 1),
49 new FailingTestCase(
50 'main() { @Constant() foo() {}; return foo(); } $CONSTANT_CLASS',
51 1),
52
53 // This tests that the compiler doesn't accept metadata on local
54 // variables. If this feature is implemented, please convert this test to
55 // a positive test in forget_element_test.dart. For example:
56 //
57 // new ForgetElementTestCase(
58 // 'main() { @Constant() var x; return x; } $CONSTANT_CLASS',
59 // metadataCount: 1),
60 new FailingTestCase(
61 'main() { @Constant() var x; return x; } $CONSTANT_CLASS',
62 1),
63 ];
64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698