<commit_before>var assert = require('assert'),
	cj = require('../out/classic.js');

describe('Extend', function() {
	
	var A, B, C;
	
	before(function() {
		
		A = cj.extend(Object, {
			x: 10,
			y: function () {
				return this.x;
			}
		});
		
		B = cj.extend(A, function (z) {
			
			var _z = z;
			
			return {
				y: function () {
					return this.x + _z;
				}
			};
		});
		
		C = cj.extend(B, function (z, w) {
			
			var _w = w;
			
			this.w = function () {
				return _w;
			};
		});
		
	});
	
	describe('overridden members', function() {
		it('Extended class should override members as expected.', function() {
			var a = new A(),
				b = new B(20),
				c = new C(40, 80);
			
			assert.equal(a.x, b.x);
			assert.equal(a.x, c.x);
			
			assert.equal(a.x, a.y());
			assert.equal(b.x + 20, b.y());
			assert.equal(c.x + 40, c.y());<commit_msg>Fine tune class test.<commit_after>var assert = require('assert'),
	cj = require('../out/classic.js');

describe('Extend', function() {
	
	describe('overridden members', function() {
		it('Extended class should override members as expected.', function() {
			
			var A = cj.extend(Object, {
				x: 10,
				y: function () {
					return this.x;
				}
			});
			var B = cj.extend(A, function (z) {
				
				var _z = z;
				
				return {
					y: function () {
						return this.x + _z;
					}
				};
			});
			var C = cj.extend(B, function (z, w) {
				
				var _w = w;
				
				this.w = function () {
					return _w;
				};
			});
			var a = new A(),
				b = new B(20),
				c = new C(40, 80);
			
			assert.equal(a.x, b.x);
			assert.equal(a.x, c.x);
			
			assert.equal(a.x, a.y());
			assert.equal(b.x + 20, b.y());
			assert.equal(c.x + 40, c.y());
{'fraction_non_alphanumeric': 0.19307511737089203, 'fraction_numerical': 0.014084507042253521, 'mean_word_length': 2.023049645390071, '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': '6908012', 'n_tokens_mistral': 883, 'n_tokens_neox': 653, 'n_words': 158}