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

Side by Side Diff: pkg/csslib/test/selector_test.dart

Issue 64373003: pkg/csslib: types, fixes, cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/csslib/test/run_all.dart ('k') | pkg/csslib/test/testing.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library selector_test; 5 library selector_test;
6 6
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'testing.dart'; 8 import 'testing.dart';
9 import 'package:csslib/parser.dart'; 9 import 'package:csslib/parser.dart';
10 import 'package:csslib/visitor.dart';
11 10
12 void testSelectorSuccesses() { 11 void testSelectorSuccesses() {
13 var errors = []; 12 var errors = [];
14 var selectorAst = selector('#div .foo', errors: errors); 13 var selectorAst = selector('#div .foo', errors: errors);
15 expect(errors.isEmpty, true, reason: errors.toString()); 14 expect(errors.isEmpty, true, reason: errors.toString());
16 expect('#div .foo', compactOuptut(selectorAst)); 15 expect('#div .foo', compactOuptut(selectorAst));
17 16
18 // Valid selectors for class names. 17 // Valid selectors for class names.
19 selectorAst = selector('.foo', errors: errors..clear()); 18 selectorAst = selector('.foo', errors: errors..clear());
20 expect(errors.isEmpty, true, reason: errors.toString()); 19 expect(errors.isEmpty, true, reason: errors.toString());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 expect(errors[0].toString(), r''' 57 expect(errors[0].toString(), r'''
59 error :1:9: name must start with a alpha character, but found a number 58 error :1:9: name must start with a alpha character, but found a number
60 .foobar .1a-story .xyzzy 59 .foobar .1a-story .xyzzy
61 ^^'''); 60 ^^''');
62 } 61 }
63 62
64 main() { 63 main() {
65 test('Valid Selectors', testSelectorSuccesses); 64 test('Valid Selectors', testSelectorSuccesses);
66 test('Invalid Selectors', testSelectorFailures); 65 test('Invalid Selectors', testSelectorFailures);
67 } 66 }
OLDNEW
« no previous file with comments | « pkg/csslib/test/run_all.dart ('k') | pkg/csslib/test/testing.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698