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

Author:
David Nickerson <david.nickerson@gmail.com>
Date:
2021-09-16 00:41:19+12:00
Desc:
Updating Noble 1962 model: * Exposing the membrane potential to the top-level model; * adding SED-ML for the paced and pacemaker variants of the model. Using OpenCOR Snapshot release 2021-09-14.
Permanent Source URI:
https://models.fieldml.org/workspace/a1/rawfile/f954e59183314cd37f86c8832dc81317d01c8ec5/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);
			}
		}
		
	]
);