Chromium Code Reviews| Index: pkg/polymer/test/build/build_log_combiner_test.dart |
| diff --git a/pkg/polymer/test/build/build_log_combiner_test.dart b/pkg/polymer/test/build/build_log_combiner_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c45af0e5bdf4fcfabe363f5bb0479a03fefd9c80 |
| --- /dev/null |
| +++ b/pkg/polymer/test/build/build_log_combiner_test.dart |
| @@ -0,0 +1,40 @@ |
| +// 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.build.build_log_combiner_test; |
| + |
| +import 'package:polymer/src/build/common.dart'; |
| +import 'package:polymer/src/build/build_log_combiner.dart'; |
| +import 'package:unittest/compact_vm_config.dart'; |
| +import 'package:unittest/unittest.dart'; |
| + |
| +import 'common.dart'; |
| + |
| +final options = new TransformOptions(injectBuildLogsInOutput: true); |
| +final phases = [[new BuildLogCombiner(options)]]; |
| + |
| +void main() { |
| + useCompactVMConfiguration(); |
| + group('combines logs', logCombiningTests); |
|
Siggi Cherem (dart-lang)
2014/08/05 19:37:21
nit: I'd inline the tests below and get rid of the
jakemac
2014/08/05 22:58:23
Done.
|
| +} |
| + |
| +void logCombiningTests() { |
| + testPhases('combines multiple logs', phases, { |
| + 'a|web/test.html': '<!DOCTYPE html><html></html>', |
| + 'a|web/test.html$LOG_EXTENSION.1': '[${buildLogString('Info', 'foo')}]', |
| + 'a|web/test.html$LOG_EXTENSION.2': |
| + '[${buildLogString('Warning', 'bar')}]', |
| + 'a|web/test.html$LOG_EXTENSION.3': '[${buildLogString('Error', 'baz')}]', |
| + }, { |
| + 'a|web/test.html': '<!DOCTYPE html><html></html>', |
| + 'a|web/test.html$LOG_EXTENSION': |
| + '[${buildLogString('Info', 'foo')},' |
| + '${buildLogString('Warning', 'bar')},' |
| + '${buildLogString('Error', 'baz')}]', |
| + }); |
| +} |
| + |
| +String buildLogString(String level, String message) { |
|
Siggi Cherem (dart-lang)
2014/08/05 19:37:21
- I'd make this private, and being private, it's o
jakemac
2014/08/05 22:58:23
Done.
|
| + return '{"level":"$level","message":"$message"}'; |
| +} |