Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1998)

Unified Diff: pkg/analyzer/test/services/formatter_test.dart

Issue 119583002: Path fix for data-driving formatting tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/services/formatter_test.dart
===================================================================
--- pkg/analyzer/test/services/formatter_test.dart (revision 31301)
+++ pkg/analyzer/test/services/formatter_test.dart (working copy)
@@ -2,7 +2,7 @@
// 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.
-//import 'dart:io';
+import 'dart:io';
import 'package:unittest/unittest.dart';
@@ -11,23 +11,24 @@
import 'package:analyzer/src/services/formatter_impl.dart';
import 'package:analyzer/src/services/writer.dart';
+// Test data location
+const TEST_DATA_DIR = 'pkg/analyzer/test/services/data';
kustermann 2014/01/02 10:22:00 You should not use forward slashes, windows uses b
pquitslund 2014/01/02 18:39:11 Ah, yes. I mistakenly thought that the new File c
+
main() {
-//TODO(pquitslund): disabled pending build investigation
+ /// Data driven statement tests
+ group('stmt_tests.data', () {
+ runTests('stmt_tests.data', (input, expectedOutput) {
+ expect(formatStatement(input) + '\n', equals(expectedOutput));
+ });
+ });
-// /// Data driven statement tests
-// group('stmt_tests.data', () {
-// runTests(new File('data/stmt_tests.data'), (input, expectedOutput) {
-// expect(formatStatement(input) + '\n', equals(expectedOutput));
-// });
-// });
-//
-// /// Data driven compilation unit tests
-// group('cu_tests.data', () {
-// runTests(new File('data/cu_tests.data'), (input, expectedOutput) {
-// expectCUFormatsTo(input, expectedOutput);
-// });
-// });
+ /// Data driven compilation unit tests
+ group('cu_tests.data', () {
+ runTests('cu_tests.data', (input, expectedOutput) {
+ expectCUFormatsTo(input, expectedOutput);
+ });
+ });
/// Formatter tests
group('formatter', () {
@@ -1308,9 +1309,11 @@
expect(formatStatement(src, options:
new FormatterOptions(codeTransforms: transforms)), equals(expected));
-runTests(testFile, expectClause(input, output)) {
+runTests(testFileName, expectClause(input, output)) {
+
var testIndex = 1;
+ var testFile = new File('$TEST_DATA_DIR/$testFileName');
kustermann 2014/01/02 10:22:00 Since you import 'dart:io' anyway, you could use d
pquitslund 2014/01/02 18:39:11 Perfect. Great idea!
var lines = testFile.readAsLinesSync();
for (var i = 1; i < lines.length; ++i) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698