This repository was archived by the owner on Nov 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
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.
4+
5+ import 'package:csslib/parser.dart' ;
6+ import 'package:csslib/visitor.dart' ;
7+ import 'package:test/test.dart' ;
8+
9+ const options = PreprocessorOptions (
10+ useColors: false ,
11+ warningsAsErrors: true ,
12+ inputFile: 'memory' ,
13+ );
14+
15+ void main () {
16+ test ('repro_136' , () {
17+ // Repro test for https://github.com/dart-lang/csslib/issues/136.
18+ final errors = < Message > [];
19+
20+ final css = '''
21+ .hero.is-white a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),
22+ .hero.is-white strong {
23+ color: inherit;
24+ }
25+ ''' ;
26+ final stylesheet = parse (css, errors: errors, options: options);
27+ expect (stylesheet.topLevels, hasLength (1 ));
28+ var ruleset = stylesheet.topLevels.first as RuleSet ;
29+
30+ // This should be length 2.
31+ expect (ruleset.selectorGroup! .selectors, hasLength (1 ));
32+
33+ // This test is expected to start to fail once we better support pseudo
34+ // selectors.
35+ // This should be empty.
36+ expect (errors, hasLength (3 ));
37+ });
38+ }
You can’t perform that action at this time.
0 commit comments