{"size": 1893, "ext": "js", "max_stars_repo_path": "test/font-face.js", "max_stars_repo_name": "mattbasta/crass", "max_stars_repo_stars_event_min_datetime": "2015-02-22T16:09:00.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-21T03:03:39.000Z", "max_issues_repo_path": "test/font-face.js", "max_issues_repo_name": "mattbasta/crass", "max_issues_repo_issues_event_min_datetime": "2015-01-29T15:26:07.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T00:24:10.000Z", "max_forks_repo_path": "test/font-face.js", "max_forks_repo_name": "mattbasta/crass", "max_forks_repo_forks_event_min_datetime": "2016-10-25T17:51:58.000Z", "max_forks_repo_forks_event_max_datetime": "2020-01-12T01:32:18.000Z"}
{"max_stars_count": 90, "max_issues_count": 55, "max_forks_count": 11, "avg_line_length": 31.55, "max_line_length": 78, "alphanum_fraction": 0.5773903856}
var assert = require('assert');

var crass = require('../src');

var filler = 'src:"";foo:bar';
var parity = function(data) {
	data = data.replace(/\$\$/g, filler);
	assert.equal(crass.parse(data).toString(), data);
    assert.equal(crass.parse(crass.parse(data).pretty()).toString(), data);
}


describe('@font-face', function() {

    it('should parse font-face blocks', function() {
        parity('@font-face{$$}');
    });

    it('should optimize', function() {
        assert.equal(
            crass.parse('@font-face{font-weight:bold}').optimize().toString(),
            '@font-face{font-weight:700}'
        );
    });

    describe('support for unicode-range in @font-face blocks', function() {
        it('should parse basic unicode code points', function() {
            parity('@font-face{$$;unicode-range:U+123}');
        });
        it('should parse wildcard unicode ranges', function() {
            parity('@font-face{$$;unicode-range:U+1??}');
        });
        it('should parse unicode ranges', function() {
            parity('@font-face{$$;unicode-range:U+123-fFFf}');
        });
    });

});

describe('@font-feature-values', function() {

    it('should parse each of the inner blocks', function() {
        parity('@font-feature-values my font{@swash{$$}}');
        parity('@font-feature-values my font{@annotation{$$}}');
        parity('@font-feature-values my font{@ornaments{$$}}');
        parity('@font-feature-values my font{@stylistic{$$}}');
        parity('@font-feature-values my font{@styleset{$$}}');
        parity('@font-feature-values my font{@character-variant{$$}}');
    });

    it('should parse multiple inner blocks', function() {
        parity('@font-feature-values my font{@annotation{$$}@swash{$$}}');
    });

    it('should parse FFVs with no inner blocks', function() {
        parity('@font-feature-values my font{}');
    });

});
