| Index: tests/compiler/dart2js/unparser2_test.dart
|
| diff --git a/tests/compiler/dart2js/unparser2_test.dart b/tests/compiler/dart2js/unparser2_test.dart
|
| index bbf3e3de93494c52b2e184e263081ca717cbff1f..ad35e2ad60ef8fd9d635bbb7cb5cfb15f9bcbfe3 100644
|
| --- a/tests/compiler/dart2js/unparser2_test.dart
|
| +++ b/tests/compiler/dart2js/unparser2_test.dart
|
| @@ -25,6 +25,11 @@ main() {
|
| testClass1Field1Method();
|
| testClass1Field2Method();
|
| testClassDefTypeParam();
|
| + testEnumDef();
|
| + testEnum1Value();
|
| + testEnum2Value();
|
| + testEnum3Value();
|
| + testEnum3CommaValue();
|
| }
|
|
|
| testClassDef() {
|
| @@ -51,10 +56,34 @@ testClassDefTypeParam() {
|
| compareCode('class T<X>{}');
|
| }
|
|
|
| -void compareCode(String code) {
|
| - Expect.equals(code, doUnparse(code));
|
| +testEnumDef() {
|
| + compareCode('enum T {}');
|
| }
|
|
|
| +testEnum1Value() {
|
| + compareCode('enum T {A}');
|
| +}
|
| +
|
| +testEnum2Value() {
|
| + compareCode('enum T {A,B}');
|
| +}
|
| +
|
| +testEnum3Value() {
|
| + compareCode('enum T {A,B,C}');
|
| +}
|
| +
|
| +testEnum3CommaValue() {
|
| + compareCode('enum T {A,B,C,}', expectedResult: 'enum T {A,B,C}');
|
| +}
|
| +
|
| +void compareCode(String code, {String expectedResult}) {
|
| + if (expectedResult == null) {
|
| + expectedResult = code;
|
| + }
|
| + Expect.equals(expectedResult, doUnparse(code));
|
| +}
|
| +
|
| +
|
| String doUnparse(String source) {
|
| MessageCollector diagnosticListener = new MessageCollector();
|
| Script script = new Script(null, null, null);
|
|
|