<commit_before>import 'package:unittest/unittest.dart';
import 'package:gloss/gloss.dart';

void main() {
  group('selector', () {
    test('can be a tag', () {
      expect(Gloss.parse('html {}'), hasLength(0));
      expect(Gloss.parse('html { color:black }'), equalsIgnoringWhitespace('html { color: #000000; }'));
    });

    test('can have nesting', () {
      expect(Gloss.parse('''html
  a
    color: #00f'''), equalsIgnoringWhitespace('html a { color: #0000ff; }'));

      expect(Gloss.parse('''html
  a
    color: #00f;
    &:hover
      color: #f00;'''), equalsIgnoringWhitespace('html a { color: #0000ff; } html a:hover { color: #ff0000; }'));

      expect(Gloss.parse('''html
  :first-child {color: #f00}'''), equalsIgnoringWhitespace('html :first-child { color: #ff0000; }'));
    });
  });
}<commit_msg>added some tests for atrule<commit_after>import 'package:unittest/unittest.dart';
import 'package:gloss/gloss.dart';

void main() {
  group('selector', () {
    test('can be a tag', () {
      expect(Gloss.parse('html {}'), hasLength(0));
      expect(Gloss.parse('html { color:black }'), equalsIgnoringWhitespace('html { color: #000000; }'));
    });

    test('can have nesting', () {
      expect(Gloss.parse('''html
  a
    color: #00f'''), equalsIgnoringWhitespace('html a { color: #0000ff; }'));

      expect(Gloss.parse('''html
  a
    color: #00f;
    &:hover
      color: #f00;'''), equalsIgnoringWhitespace('html a { color: #0000ff; } html a:hover { color: #ff0000; }'));

      expect(Gloss.parse('''html
  :first-child {color: #f00}'''), equalsIgnoringWhitespace('html :first-child { color: #ff0000; }'));
    });
  });
  
  group('atrule', () {
    test('can have simple rule', () {
      expect(Gloss.parse('''
@media all {
  body
    font-size: 1.5em
}
'''), equalsIgnoringWhitespace('@media all { body { font-size: 1.5em; } }'));
    });
    
    test('can have comples rules', () {
      expect(Gloss.parse('''
@media all and (max-width: 699px) and (min-width: 520px), (min-width: 1151px) {
  body
    background: #ccc
}
'''), equalsIgnoringWhitespace('@media all and ( max-width : 699px ) and ( min-width : 520px ), ( min-width : 1151px ) { body { background: #cccccc; } }'));
    });
    
    test('can have string', () {
      expect(Gloss.parse('''
@import "imported.css"
'''), equalsIgnoringWhitespace('@import "imported.css";')); 
    });
    
    test('can have url', () {
      expect(Gloss.parse('''
@import url(imported.css)
'''), equalsIgnoringWhitespace('@import url(imported.css);')); 
    });
  });
}
{'fraction_non_alphanumeric': 0.21003134796238246, 'fraction_numerical': 0.03369905956112853, 'mean_word_length': 3.6758241758241756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4400044', 'n_tokens_mistral': 965, 'n_tokens_neox': 892, 'n_words': 171}