2015-03-06 14:10:14 -05:00
|
|
|
library angular2.test.transform.reflection_remover;
|
|
|
|
|
|
|
|
import 'package:analyzer/analyzer.dart';
|
|
|
|
import 'package:angular2/src/transform/reflection_remover/codegen.dart';
|
|
|
|
import 'package:angular2/src/transform/reflection_remover/rewriter.dart';
|
|
|
|
import 'package:unittest/unittest.dart';
|
|
|
|
|
|
|
|
import 'reflection_remover_files/expected/index.dart' as expected;
|
|
|
|
import '../common/read_file.dart';
|
|
|
|
|
|
|
|
void allTests() {
|
2015-03-16 16:32:29 -04:00
|
|
|
var codegen = new Codegen('web/index.dart', 'web/index.ng_deps.dart');
|
2015-03-06 14:10:14 -05:00
|
|
|
|
2015-03-12 16:18:36 -04:00
|
|
|
test('should remove uses of mirrors & insert calls to generated code.', () {
|
2015-03-06 14:10:14 -05:00
|
|
|
var code =
|
|
|
|
readFile('reflection_remover/reflection_remover_files/index.dart');
|
|
|
|
var output =
|
|
|
|
new Rewriter(code, codegen).rewrite(parseCompilationUnit(code));
|
|
|
|
expect(output, equals(expected.code));
|
|
|
|
});
|
|
|
|
}
|