<commit_before>var husl = require('../husl');
var expect = require('chai').expect;

var black = "#000000",
    grey = "#777777",
    white = "#FFFFFF",
    red = "#FF0000",
    green = "#00FF00",
    blue = "#0000FF";

describe('HuSL', function () {
	it('hue order', function () {
		expect(husl.fromHex(red)[0]).to.be.below(husl.fromHex(green)[0]);
		expect(husl.fromHex(green)[0]).to.be.below(husl.fromHex(blue)[0]);
	});
	it('saturation order', function () {
		expect(husl.fromHex(grey)[1]).to.be.below(husl.fromHex(red)[1]);
	});
	it('lightness order', function () {
		expect(husl.fromHex(black)[2]).to.be.below(husl.fromHex(grey)[2]);
		expect(husl.fromHex(grey)[2]).to.be.below(husl.fromHex(white)[2]);
		expect(husl.fromHex(blue)[2]).to.be.below(husl.fromHex(red)[2]);
		expect(husl.fromHex(red)[2]).to.be.below(husl.fromHex(green)[2]);
	});
});<commit_msg>Add test for saturation upper bound<commit_after>var husl = require('../husl');
var expect = require('chai').expect;

var comp = [];
for (var i = 0; i < 16; i++) {
	var h = i.toString(16);
	comp.push(h + h);
}

var black = "#000000",
    grey = "#777777",
    white = "#FFFFFF",
    red = "#FF0000",
    green = "#00FF00",
    blue = "#0000FF";

describe('HuSL', function () {
	it('hue order', function () {
		expect(husl.fromHex(red)[0]).to.be.below(husl.fromHex(green)[0]);
		expect(husl.fromHex(green)[0]).to.be.below(husl.fromHex(blue)[0]);
	});
	it('saturation order', function () {
		expect(husl.fromHex(grey)[1]).to.be.below(husl.fromHex(red)[1]);
	});
	it('lightness order', function () {
		expect(husl.fromHex(black)[2]).to.be.below(husl.fromHex(grey)[2]);
		expect(husl.fromHex(grey)[2]).to.be.below(husl.fromHex(white)[2]);
		expect(husl.fromHex(blue)[2]).to.be.below(husl.fromHex(red)[2]);
		expect(husl.fromHex(red)[2]).to.be.below(husl.fromHex(green)[2]);
	});
	it('saturation upper bound', function () {
		comp.forEach(function (r) {
			comp.forEach(function (g) {
				comp.forEach(function (b) {
					var c = husl.fromHex("#" + r + g + b);
					expect(c[1]).to.be.below(100.1);
				});
			});
		});
	});
});
{'fraction_non_alphanumeric': 0.24448705656759348, 'fraction_numerical': 0.04122722914669223, 'mean_word_length': 4.565333333333333, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1620416', 'n_tokens_mistral': 928, 'n_tokens_neox': 829, 'n_words': 110}