| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Unit test of the [NativeBehavior.processSpecString] method. | 5 // Unit test of the [NativeBehavior.processSpecString] method. |
| 6 | 6 |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 import 'package:compiler/src/native/native.dart'; | 8 import 'package:compiler/src/native/native.dart'; |
| 9 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; | 9 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; |
| 10 import 'package:compiler/src/diagnostics/messages.dart'; | 10 import 'package:compiler/src/diagnostics/messages.dart'; |
| 11 import 'package:compiler/src/universe/side_effects.dart' | 11 import 'package:compiler/src/universe/side_effects.dart' |
| 12 show SideEffects; | 12 show SideEffects; |
| 13 | 13 |
| 14 const OBJECT = 'Object'; | 14 const OBJECT = 'Object'; |
| 15 const NULL = 'Null'; | 15 const NULL = 'Null'; |
| 16 | 16 |
| 17 class Listener extends DiagnosticListener { | 17 class Listener extends DiagnosticReporter { |
| 18 String errorMessage; | 18 String errorMessage; |
| 19 internalError(spannable, message) { | 19 internalError(spannable, message) { |
| 20 errorMessage = message; | 20 errorMessage = message; |
| 21 throw "error"; | 21 throw "error"; |
| 22 } | 22 } |
| 23 reportError(message, [infos]) { | 23 reportError(message, [infos]) { |
| 24 | 24 |
| 25 errorMessage = | 25 errorMessage = |
| 26 '${message.message.arguments}'; // E.g. "{text: Duplicate tag 'new'.}" | 26 '${message.message.arguments}'; // E.g. "{text: Duplicate tag 'new'.}" |
| 27 throw "error"; | 27 throw "error"; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 test('gvn:false', expectedGvn: false); | 284 test('gvn:false', expectedGvn: false); |
| 285 test('returns:A;gvn:true', returns: ['A'], expectedGvn: true); | 285 test('returns:A;gvn:true', returns: ['A'], expectedGvn: true); |
| 286 test(' gvn : true ; returns:A;', returns: ['A'], expectedGvn: true); | 286 test(' gvn : true ; returns:A;', returns: ['A'], expectedGvn: true); |
| 287 test('gvn:true;returns:A;gvn:true', expectError: true); | 287 test('gvn:true;returns:A;gvn:true', expectError: true); |
| 288 | 288 |
| 289 test('gvn: true; new: true', expectError: true); | 289 test('gvn: true; new: true', expectError: true); |
| 290 test('gvn: true; new: false', expectedGvn: true, expectedNew: false); | 290 test('gvn: true; new: false', expectedGvn: true, expectedNew: false); |
| 291 test('gvn: false; new: true', expectedGvn: false, expectedNew: true); | 291 test('gvn: false; new: true', expectedGvn: false, expectedNew: true); |
| 292 test('gvn: false; new: false', expectedGvn: false, expectedNew: false); | 292 test('gvn: false; new: false', expectedGvn: false, expectedNew: false); |
| 293 } | 293 } |
| OLD | NEW |