<commit_before>module('Path Style');

test('currentStyle', function() {
	var doc = new Document();
	doc.currentStyle.fillColor = 'black';
	var path = new Path();
	compareRGBColors(path.fillColor, 'black', 'path.fillColor');
	
	// When changing the current style of the document, the style of
	// paths created using document.currentStyle should not change.
	doc.currentStyle.fillColor = 'red';
	compareRGBColors(path.fillColor, 'black', 'path.fillColor');
});

test('setting currentStyle to an object', function() {
	var doc = new Document();
	doc.currentStyle = {
		fillColor: 'red',
		strokeColor: 'green'
	};
	var path = new Path();
	compareRGBColors(path.fillColor, 'red', 'path.fillColor');
	compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
});

test('setting path styles to an object', function() {
	var doc = new Document();
	var path = new Path();
	path.style = {
		fillColor: 'red',
		strokeColor: 'green'
	};
	compareRGBColors(path.fillColor, 'red', 'path.fillColor');
	compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
});

test('setting group styles to an object', function() {
	var doc = new Document();
	var group = new Group();
	var path = new Path();
	group.appendTop(path);
	group.style = {
		fillColor: 'red',
		strokeColor: 'green'
	};
	compareRGBColors(path.fillColor, 'red', 'path.fillColor');
	compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
});

test('getting group styles', function() {
	var doc = new Document();
	var group = new Group();
	var path = new Path();
	path.fillColor = 'red';
	group.appendTop(path);

	compareRGBColors(group.fillColor, 'red', 'group.fillColor');
	
	var secondPath = new Path();
	secondPath.fillColor = 'black';
	group.appendTop(secondPath);
	
	// the group now contains two paths with different fillColors and therefore
	// should return null:
	equals(group.fillColor, null, 'group.fillColor');
	
	//If we remove the first path, it should now return 'black':
	group.children[0].remove();
	compareRGBColors(group.fillColor, 'black', 'group.fillColor');
});

test('setting group styles', function() {
	var doc = new Document();
	var group = new Group();
	var path = new Path();
	path.fillColor = 'red';
	group.appendTop(path);

	var secondPath = new Path();
	secondPath.fillColor = 'blue';
	secondPath.strokeColor = 'red';
	group.appendTop(secondPath);
	
	// Change the fill color of the group:
	group.fillColor = 'black';
	
	// the paths contained in the group should now both have their fillColor
	// set to black:
	compareRGBColors(path.fillColor, 'black', 'path.fillColor');
	compareRGBColors(secondPath.fillColor, 'black', 'secondPath.fillColor');
	
	// The second path still has its strokeColor set to red:
	compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');
});

test('setting group styles 2', function() {
	var doc = new Document();
	var group = new Group();
	var path = new Path();
	path.fillColor = 'red';
	group.appendTop(path);
	
	compareRGBColors(group.fillColor, 'red', 'group.fillColor');
	
	var secondPath = new Path();
	secondPath.fillColor = 'blue';
	secondPath.strokeColor = 'red';
	group.appendTop(secondPath);
	
	compareRGBColors(secondPath.fillColor, 'blue', 'secondPath.fillColor');
	compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');

	// By appending a path with a different fillcolor,
	// the group's fillColor should return undefined:
	equals(group.fillColor, undefined, 'group.fillColor');
	
	// But, both paths have a red strokeColor, so:
	compareRGBColors(group.strokeColor, 'red', 'group.strokeColor');
	
	// Change the fill color of the group's style:
	group.style.fillColor = 'black';
	
	// the paths contained in the group should now both have their fillColor
	// set to black:
	compareRGBColors(path.fillColor, 'black', 'path.fillColor');
	compareRGBColors(secondPath.fillColor, 'black', 'secondPath.fillColor');
	
	// The second path still has its strokeColor set to red:
	compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');
});<commit_msg>Fix forgoten compare in test.<commit_after>module('Path Style');

test('currentStyle', function() {
	var doc = new Document();
	doc.currentStyle.fillColor = 'black';
	var path = new Path();
	compareRGBColors(path.fillColor, 'black', 'path.fillColor');
	
	// When changing the current style of the document, the style of
	// paths created using document.currentStyle should not change.
	doc.currentStyle.fillColor = 'red';
	compareRGBColors(path.fillColor, 'black', 'path.fillColor');
});

test('setting currentStyle to an object', function() {
	var doc = new Document();
	doc.currentStyle = {
		fillColor: 'red',
		strokeColor: 'green'
	};
	var path = new Path();
	compareRGBColors(path.fillColor, 'red', 'path.fillColor');
	compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
});

test('setting path styles to an object', function() {
	var doc = new Document();
	var path = new Path();
	path.style = {
		fillColor: 'red',
		strokeColor: 'green'
	};
	compareRGBColors(path.fillColor, 'red', 'path.fillColor');
	compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
});

test('setting group styles to an object', function() {
	var doc = new Document();
	var group = new Group();
	var path = new Path();
	group.appendTop(path);
	group.style = {
		fillColor: 'red',
		strokeColor: 'green'
	};
	compareRGBColors(path.fillColor, 'red', 'path.fillColor');
	compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
});

test('getting group styles', function() {
	var doc = new Document();
	var group = new Group();
	var path = new Path();
	path.fillColor = 'red';
	group.appendTop(path);

	compareRGBColors(group.fillColor, 'red', 'group.fillColor');
	
	var secondPath = new Path();
	secondPath.fillColor = 'black';
	group.appendTop(secondPath);
	
	// the group now contains two paths with different fillColors and therefore
	// should return undefined:
	equals(group.fillColor, undefined, 'group.fillColor');
	
	//If we remove the first path, it should now return 'black':
	group.children[0].remove();
	compareRGBColors(group.fillColor, 'black', 'group.fillColor');
});

test('setting group styles', function() {
	var doc = new Document();
	var group = new Group();
	var path = new Path();
	path.fillColor = 'red';
	group.appendTop(path);

	var secondPath = new Path();
	secondPath.fillColor = 'blue';
	secondPath.strokeColor = 'red';
	group.appendTop(secondPath);
	
	// Change the fill color of the group:
	group.fillColor = 'black';
	
	// the paths contained in the group should now both have their fillColor
	// set to black:
	compareRGBColors(path.fillColor, 'black', 'path.fillColor');
	compareRGBColors(secondPath.fillColor, 'black', 'secondPath.fillColor');
	
	// The second path still has its strokeColor set to red:
	compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');
});

test('setting group styles 2', function() {
	var doc = new Document();
	var group = new Group();
	var path = new Path();
	path.fillColor = 'red';
	group.appendTop(path);
	
	compareRGBColors(group.fillColor, 'red', 'group.fillColor');
	
	var secondPath = new Path();
	secondPath.fillColor = 'blue';
	secondPath.strokeColor = 'red';
	group.appendTop(secondPath);
	
	compareRGBColors(secondPath.fillColor, 'blue', 'secondPath.fillColor');
	compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');

	// By appending a path with a different fillcolor,
	// the group's fillColor should return undefined:
	equals(group.fillColor, undefined, 'group.fillColor');
	
	// But, both paths have a red strokeColor, so:
	compareRGBColors(group.strokeColor, 'red', 'group.strokeColor');
	
	// Change the fill color of the group's style:
	group.style.fillColor = 'black';
	
	// the paths contained in the group should now both have their fillColor
	// set to black:
	compareRGBColors(path.fillColor, 'black', 'path.fillColor');
	compareRGBColors(secondPath.fillColor, 'black', 'secondPath.fillColor');
	
	// The second path still has its strokeColor set to red:
	compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');
});
{'fraction_non_alphanumeric': 0.14470443349753695, 'fraction_numerical': 0.0004926108374384236, 'mean_word_length': 4.997784342688331, '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': '7186019', 'n_tokens_mistral': 2542, 'n_tokens_neox': 2501, 'n_words': 732}