<commit_before>component extends="org.lucee.cfml.test.LuceeTestCase"   {

	function run( testResults , testBox ) {

		describe( 'LDEV-434 DeserializeJSON' , function() {

			it( 'should error when too a trailing comma is included on a simple array' , function() {
				var bad_json = '[1,]';
				expect(function(){
					DeserializeJSON( bad_json );
				}).toThrow();
			});

			it( 'should error when too a trailing comma is included on an empty array' , function() {
				var bad_json = '[,]';
				expect(function(){
					DeserializeJSON( bad_json );
				}).toThrow();
			});

			it( 'should be ok if the string is ok' , function() {
				var good_json = '[1,2]';
				expect( DeserializeJSON( good_json ) ).toBe([1,2]);
			});

			it( 'should be still allow a trailing comma for a CF array' , function() {
				expect( [1,2,] ).toBe( [1,2] );
			});

		});

	}
	
} <commit_msg>Added unit tests for IsJSON also showing it to be working<commit_after>component extends="org.lucee.cfml.test.LuceeTestCase"   {

	function run( testResults , testBox ) {

		describe( 'LDEV-434 DeserializeJSON' , function() {

			it( 'should error when too a trailing comma is included on a simple array' , function() {
				var bad_json = '[1,]';
				expect(function(){
					DeserializeJSON( bad_json );
				}).toThrow();
			});

			it( 'should error when too a trailing comma is included on an empty array' , function() {
				var bad_json = '[,]';
				expect(function(){
					DeserializeJSON( bad_json );
				}).toThrow();
			});

			it( 'should be ok if the string is ok' , function() {
				var good_json = '[1,2]';
				expect( DeserializeJSON( good_json ) ).toBe([1,2]);
			});

			it( 'should be still allow a trailing comma for a CF array' , function() {
				expect( [1,2,] ).toBe( [1,2] );
			});

		});

		describe( 'LDEV-434 IsJSON' , function() {

			it( 'should be false when too a trailing comma is included on a simple array' , function() {
				expect( IsJSON( '[1,]' ) ).toBeFalse();
			});

			it( 'should false when too a trailing comma is included on an empty array' , function() {
				expect( IsJSON( '[,]' ) ).toBeFalse();
			});

			it( 'should be true if the string is ok' , function() {
				expect( IsJSON( '[1,2]' ) ).toBeTrue();
			});

		});

	}
	
} 
{'fraction_non_alphanumeric': 0.1592526690391459, 'fraction_numerical': 0.013345195729537367, 'mean_word_length': 3.074275362318841, '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': '2343819', 'n_tokens_mistral': 890, 'n_tokens_neox': 717, 'n_words': 240}