| Index: tests/language/scope_variable_test.dart
|
| diff --git a/tests/language/scope_variable_test.dart b/tests/language/scope_variable_test.dart
|
| index d3bca7cc1ea376c779786b683388a00e58d0511c..1437de64dabcf928766ce409c0e931c96dac8b56 100644
|
| --- a/tests/language/scope_variable_test.dart
|
| +++ b/tests/language/scope_variable_test.dart
|
| @@ -4,38 +4,44 @@
|
|
|
| import "package:expect/expect.dart";
|
|
|
| -class ScopeVariableTest {
|
| -
|
| - static void testSimpleScope() {
|
| - {
|
| - var a = "Test";
|
| - int b = 1;
|
| - }
|
| - {
|
| - var c;
|
| - int d;
|
| - Expect.equals(true, c == null);
|
| - Expect.equals(true, d == null);
|
| - }
|
| +void testSimpleScope() {
|
| + {
|
| + var a = "Test";
|
| + int b = 1;
|
| + }
|
| + {
|
| + var c;
|
| + int d;
|
| + Expect.isNull(c);
|
| + Expect.isNull(d);
|
| }
|
| +}
|
|
|
| - static void testShadowingScope() {
|
| - var a = "Test";
|
| - {
|
| - var a;
|
| - Expect.equals(true, a == null);
|
| - a = "a";
|
| - Expect.equals(true, a == "a");
|
| - }
|
| - Expect.equals(true, a == "Test");
|
| +void testShadowingScope() {
|
| + var a = "Test";
|
| + {
|
| + var a;
|
| + Expect.equals(true, a == null);
|
| + a = "a";
|
| + Expect.equals(true, a == "a");
|
| }
|
| + Expect.equals(true, a == "Test");
|
| +}
|
|
|
| - static void testMain() {
|
| - testSimpleScope();
|
| - testShadowingScope();
|
| +int testShadowingAfterUse() {
|
| + var a = 1;
|
| + {
|
| + var b = 2;
|
| + var c = a; // Use of 'a' prior to its shadow declaration below.
|
| + var d = b + c;
|
| + // Shadow declaration of 'a'.
|
| + var a = 5; /// 01: compile-time error
|
| + return d + a;
|
| }
|
| }
|
|
|
| main() {
|
| - ScopeVariableTest.testMain();
|
| + testSimpleScope();
|
| + testShadowingScope();
|
| + testShadowingAfterUse();
|
| }
|
|
|