<commit_before>// RENDERING TESTS
// ===============
//
// This loads in the render.json sample file and checks that each compiled
// template, in combination with the sample data, produces the expected
// HTML.
//
// TODO: add moar samples

QUnit.config.reorder = false;

var fixture = document.getElementById( 'qunit-fixture' ), tests;

tests = [
	{
		name: 'Subclass instance data extends prototype data',
		test: function () {
			var Subclass, instance;

			Subclass = Ractive.extend({
				template: '{{foo}} {{bar}}',
				data: { foo: 1 }
			});

			instance = new Subclass({
				el: fixture,
				data: { bar: 2 }
			});

			equal( fixture.innerHTML, '1 2' );
			deepEqual( instance.get(), { foo: 1, bar: 2 });
		}
	},
	{
		name: 'Multiple identical evaluators merge',
		test: function () {
			var ractive;

			ractive = new Ractive({
				el: fixture,
				template: '{{( a+b )}} {{( a+b )}} {{( a+b )}}',
				data: { a: 1, b: 2 }
			});
			
			equal( fixture.innerHTML, '3 3 3' );

			equal( ractive._deps.a.length, 1 );
			equal( ractive._deps.a[0].length, 1 );

			equal( ractive._deps.b.length, 1 );
			equal( ractive._deps.b[0].length, 1 );
		}
	},
	{
		name: 'Boolean attributes work as expected',
		test: function () {
			var ractive;

			ractive = new Ractive({
				el: fixture,
				template: '<input id="one" type="checkbox" checked="{{falsy}}"><input id="two" type="checkbox" checked="{{truthy}}">',
				data: { truthy: true, falsy: false }
			});

			equal( ractive.nodes.one.checked, false );<commit_msg>updated a test<commit_after>// RENDERING TESTS
// ===============
//
// This loads in the render.json sample file and checks that each compiled
// template, in combination with the sample data, produces the expected
// HTML.
//
// TODO: add moar samples

QUnit.config.reorder = false;

var fixture = document.getElementById( 'qunit-fixture' ), tests;

tests = [
	{
		name: 'Subclass instance data extends prototype data',
		test: function () {
			var Subclass, instance;

			Subclass = Ractive.extend({
				template: '{{foo}} {{bar}}',
				data: { foo: 1 }
			});

			instance = new Subclass({
				el: fixture,
				data: { bar: 2 }
			});

			equal( fixture.innerHTML, '1 2' );
			deepEqual( instance.get(), { foo: 1, bar: 2 });
		}
	},
	{
		name: 'Multiple identical evaluators merge',
		test: function () {
			var ractive;

			ractive = new Ractive({
				el: fixture,
				template: '{{( a+b )}} {{( a+b )}} {{( a+b )}}',
				data: { a: 1, b: 2 }
			});
			
			equal( fixture.innerHTML, '3 3 3' );

			equal( ractive._deps.length, 1 );
			equal( ractive._deps[0].a.length, 1 );

			equal( ractive._deps[0].b.length, 1 );
		}
	},
	{
		name: 'Boolean attributes work as expected',
		test: function () {
			var ractive;

			ractive = new Ractive({
				el: fixture,
				template: '<input id="one" type="checkbox" checked="{{falsy}}"><input id="two" type="checkbox" checked="{{truthy}}">',
				data: { truthy: true, falsy: false }
			});

			equal( ractive.nodes.one.checked, false );
{'fraction_non_alphanumeric': 0.18266666666666667, 'fraction_numerical': 0.011, 'mean_word_length': 3.0227882037533513, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3347064', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1014, 'n_words': 293}