<commit_before>/*
* @project {{=it.name}}
* @author <NAME>
* @license {{=it.license.overview}}
*/

tests.runBaseTests = function(){
	module( "YASMIJ.base Class" );

	test( "test YASMIJ.CONST", function(){
		var x = YASMIJ.CONST;
		ok(x);
		ok(x.STANDARD_MAX);
		ok(x.STANDARD_MIN);
		ok(x.NONSTANDARD_MAX);
		ok(x.NONSTANDARD_MIN);
	});
	test( "test YASMIJ.getErrors()", function(){
		var fn = YASMIJ.getErrors;
		ok( fn() );
		ok( fn({}) );
		ok( fn({type:{}, constraints: {} }) );
		ok( !fn({type:{}, constraints: {}, objective : "a+b" }) );
	});
	test( "test YASMIJ.solve() with maximization", function(){
		var fn = function(input){
			return (YASMIJ.solve(input)||{}).result;
		}
		// Problem taken from `http://www.ms.uky.edu/~rwalker/Class%20Work%20Solutions/class%20work%208%20solutions.pdf`
		var input = {
			"type": "maximize",
			"objective": "3x + 4y",
			"constraints": [
				"x + y <= 4",
				"2x + y <= 5"
			]
		};
		deepEqual( fn(input), {
				"slack1": 0,
				"slack2": 1,
				"x": 0,
				"y": 4,
				"z": 16
		});
	});
		test( "test YASMIJ.solve() with non-standard maximization", function(){
		var fn = function(input){
			return (YASMIJ.solve(input)||{}).result;
		}
		// Problem taken from `http://people.hofstra.edu/stefan_waner/realworld/tutorialsf4/frames4_4.html`
		var input = {
			"type": "maximize",
			"objective": "-2x - y - 2z1",
			"constraints": [
				"2x + 4y + z1 >= 80",
				"x + 5y + z1 <= 100 ",
				"x + 2y + z1 >= 50 "
			]
		}
		deepEqual( fn(input), {
				"slack1": 0,
				"slack2": 0,
				"slack3": 0,				
				"x": 0,
				"y": 50/3,
				"z": 50/3,
				"z": -50
		});<commit_msg>Update YASMIJ.base-testcases.js<commit_after>/*
* @project {{=it.name}}
* @author <NAME>
* @license {{=it.license.overview}}
*/

tests.runBaseTests = function(){
	module( "YASMIJ.base Class" );

	test( "test YASMIJ.CONST", function(){
		var x = YASMIJ.CONST;
		ok(x);
		ok(x.STANDARD_MAX);
		ok(x.STANDARD_MIN);
		ok(x.NONSTANDARD_MAX);
		ok(x.NONSTANDARD_MIN);
	});
	test( "test YASMIJ.solve() with maximization", function(){
		var fn = function(input){
			return (YASMIJ.solve(input)||{}).result;
		}
		// Problem taken from `http://www.ms.uky.edu/~rwalker/Class%20Work%20Solutions/class%20work%208%20solutions.pdf`
		var input = {
			"type": "maximize",
			"objective": "3x + 4y",
			"constraints": [
				"x + y <= 4",
				"2x + y <= 5"
			]
		};
		deepEqual( fn(input), {
				"slack1": 0,
				"slack2": 1,
				"x": 0,
				"y": 4,
				"z": 16
		});
	});
	// remove when maximization is fully implemented.
	return;
	
	test( "test YASMIJ.solve() with non-standard maximization", function(){
		var fn = function(input){
			return (YASMIJ.solve(input)||{}).result;
		}
		// Problem taken from `http://people.hofstra.edu/stefan_waner/realworld/tutorialsf4/frames4_4.html`
		var input = {
			"type": "maximize",
			"objective": "-2x - y - 2z1",
			"constraints": [
				"2x + 4y + z1 >= 80",
				"x + 5y + z1 <= 100 ",
				"x + 2y + z1 >= 50 "
			]
		}
		deepEqual( fn(input), {
				"slack1": 0,
				"slack2": 0,
				"slack3": 0,				
				"x": 0,
				"y": 50/3,
				"z": 50/3,
				"z": -50
		});
{'fraction_non_alphanumeric': 0.21683263732733699, 'fraction_numerical': 0.037905557340186316, 'mean_word_length': 2.946768060836502, 'pattern_counts': {'":': 36, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6179960', 'n_tokens_mistral': 1605, 'n_tokens_neox': 1320, 'n_words': 263}