Location: A review of cardiac cellular electrophysiology models @ c47db6b2fedb / dojo-presentation / js / dojo / dojox / string / tests / BidiComplex.js

Author:
David Nickerson <david.nickerson@gmail.com>
Date:
2021-09-17 15:39:51+12:00
Desc:
tweak html formatting
Permanent Source URI:
https://models.fieldml.org/workspace/a1/rawfile/c47db6b2fedb368422c7f4d5191aeb9f319ad684/dojo-presentation/js/dojo/dojox/string/tests/BidiComplex.js

dojo.provide("dojox.string.tests.BidiComplex");
dojo.require("dojox.string.BidiComplex");

tests.register("dojox.string.tests.BidiComplex", 
	[
		{
			name: "createDisplayString: FILE_PATH",
			runTest: function(t){
				var originalString = "c:\\قائمة\\ملف.txt";	
				var fixedString="‪c:\\قائمة‎\\ملف‎.txt";				
				var displayString = dojox.string.BidiComplex.createDisplayString(originalString, "FILE_PATH");
				t.is(displayString, fixedString);

//				originalString = "c:\\אבג\\דהו\\123\\אa";	
//				fixedString="‪‪c:\\אבג‎\\דהו‎\\123‎\\אa";				
//				var displayString = dojox.string.BidiComplex.createDisplayString(originalString, "FILE_PATH");
//				t.is(displayString, fixedString);
			}
		},
		{
			name: "stripSpecialCharacters: FILE_PATH",
			runTest: function(t){
				var originalString = "c:\\قائمة\\ملف.txt";	
				var fixedString="‪c:\\قائمة‎\\ملف‎.txt";				
				var stripedString = dojox.string.BidiComplex.stripSpecialCharacters(fixedString);
				t.is(stripedString, originalString);
			}
		},
		{
			name: "createDisplayString: EMAIL",
			runTest: function(t){
				var originalString = "موظف@شركة.com";
				var fixedString="‪موظف‎@شركة‎.com";				
				var displayString = dojox.string.BidiComplex.createDisplayString(originalString, "EMAIL");
				t.is(displayString, fixedString);
			}
		},
		{
			name: "stripSpecialCharacters: EMAIL",
			runTest: function(t){
				var originalString = "موظف@شركة.com";	
				var fixedString="‪موظف‎@شركة‎.com";				
				var stripedString = dojox.string.BidiComplex.stripSpecialCharacters(fixedString);
				t.is(stripedString, originalString);
			}
		},
		{
			name: "createDisplayString: URL",
			runTest: function(t){
				var originalString ="http://قطاع.شركة.com/الموقع/صفحة?دليل=اختبار&&تعيين=نعم"; 
				var fixedString="‪http://قطاع‎.شركة‎.com/الموقع‎/صفحة‎?دليل‎=اختبار‎&&تعيين‎=نعم";					
				var displayString = dojox.string.BidiComplex.createDisplayString(originalString, "URL");
				t.is(displayString, fixedString);
			}
		},
		{
			name: "stripSpecialCharacters: URL",
			runTest: function(t){
				var originalString ="http://قطاع.شركة.com/الموقع/صفحة?دليل=اختبار&&تعيين=نعم"; 
				var fixedString="‪http://قطاع‎.شركة‎.com/الموقع‎/صفحة‎?دليل‎=اختبار‎&&تعيين‎=نعم";				
				var stripedString = dojox.string.BidiComplex.stripSpecialCharacters(fixedString);
				t.is(stripedString, originalString);
			}
		}
		
	]
);