<commit_before>component extends="org.lucee.cfml.test.LuceeTestCase"{
	function beforeAll(){
		
	}

	function run( testResults , testBox ) {
		describe( "Test suite Mappings", function() {
			it( title='test sub mappings', body=function( currentSpec ) {
				var curr=getDirectoryFromPath(getCurrentTemplatePath());
				var parent=getDirectoryFromPath(mid(curr,1,len(curr)-1));
				var org = getApplicationSettings().mappings;
				var mappings = duplicate(org);
				try {
					mappings[ '/' ] = parent;
					mappings[ '/diff' ] = curr;//parent&"other";
		
					application action="update" mappings="#mappings#";
					expect(expandPath("/diff/susi.cfm")).toBe(curr&"susi.cfm");
				}
				finally {
					application action="update" mappings="#org#";
				}
			});


		});
	}

}<commit_msg>add testcase for mappings<commit_after>component extends="org.lucee.cfml.test.LuceeTestCase"{
	function beforeAll(){
		
	}

	function run( testResults , testBox ) {
		describe( "Test suite Mappings", function() {
			it( title='test sub mappings for non existing files', body=function( currentSpec ) {
				var curr=getDirectoryFromPath(getCurrentTemplatePath());
				var parent=getDirectoryFromPath(mid(curr,1,len(curr)-1));
				var org = getApplicationSettings().mappings;
				var mappings = duplicate(org);
				try {
					mappings[ '/' ] = parent;
					mappings[ '/diff' ] = curr;//parent&"other";
		
					application action="update" mappings="#mappings#";
					expect(expandPath("/diff/susi.cfm")).toBe(curr&"susi.cfm");
				}
				finally {
					application action="update" mappings="#org#";
				}
			});

			it( title='test sub mappings for existing files', body=function( currentSpec ) {
				var curr=getDirectoryFromPath(getCurrentTemplatePath());
				var p=getDirectoryFromPath(mid(curr,1,len(curr)-1));
				var rel=replace(getCurrentTemplatePath(),p,'');
				var pp=getDirectoryFromPath(mid(p,1,len(p)-1));
				var org = getApplicationSettings().mappings;
				var mappings = duplicate(org);
				
				try {
					mappings[ '/' ] = p;
					mappings[ '/diff' ] = curr;//parent&"other";

					application action="update" mappings="#mappings#";

					expect(expandPath("/"&rel)).toBe(getCurrentTemplatePath());
					expect(expandPath("/diff/"&rel)).toBe(curr&rel);

					// /Users/mic/Test/test2/webapps/ROOT/test/testcases/testcases/Mappings.cfc
				}
				finally {
					application action="update" mappings="#org#";
				}
			});


		});
	}

}
{'fraction_non_alphanumeric': 0.16378600823045267, 'fraction_numerical': 0.003703703703703704, 'mean_word_length': 3.891348088531187, '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': '7189249', 'n_tokens_mistral': 959, 'n_tokens_neox': 767, 'n_words': 132}