// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library polymer.test.transform.code_extractor_test; import 'package:polymer/src/transform/code_extractor.dart'; import 'package:unittest/compact_vm_config.dart'; import 'common.dart'; void main() { useCompactVMConfiguration(); testPhases('no changes', [[new InlineCodeExtractor()]], { 'a|web/test.html': '', }, { 'a|web/test.html': '', }); testPhases('single script, no library in script', [[new InlineCodeExtractor()]], { 'a|web/test.html': '
' '', }, { 'a|web/test.html': '' '' '', 'a|web/test.html.0.dart': 'library web_test_html_0;\nmain() { }', }); testPhases('single script, with library', [[new InlineCodeExtractor()]], { 'a|web/test.html': '' '', }, { 'a|web/test.html': '' '' '', 'a|web/test.html.0.dart': 'library f;\nmain() { }', }); testPhases('under lib/ directory also transformed', [[new InlineCodeExtractor()]], { 'a|lib/test.html': '' '', }, { 'a|lib/test.html': '' '' '', 'a|lib/test.html.0.dart': 'library f;\nmain() { }', }); testPhases('multiple scripts', [[new InlineCodeExtractor()]], { 'a|web/test.html': '' '' '', }, { 'a|web/test.html': '' '' '' '', 'a|web/test.html.0.dart': 'library a1;\nmain1() { }', 'a|web/test.html.1.dart': 'library a2;\nmain2() { }', }); testPhases('multiple deeper scripts', [[new InlineCodeExtractor()]], { 'a|web/test.html': '' '' '