public void Can_call_native_function_without_args() { _t.Runtime.RegisterFunction("test.hello", GetType().GetMethod("TestHello"), new DekiScriptNativeInvocationTarget.Parameter[0]); _t.Test( "test.hello();", "hello", typeof(DekiScriptString), false ); }
public void Apply() { _t.Test( @"var x = { ""a"":""b"", 1:4 }; map.apply(x, ""$.value+5"");", @"{ 1 : 9, a : nil }", typeof(DekiScriptMap) ); }
public void Can_call_iterator_on_list_to_build_list() { _t.Test(@" var x = [1,2,3]; [ (v2) foreach var v in x, var v2 = v*v ];", "[ 1, 4, 9 ]", typeof(DekiScriptList)); }
public void Date() { _t.Test( "xml.date(web.xml(\"" + testXml + "\"), \"somedata/date\");", @"Sat, 01 Jan 2000 08:00:00 GMT", typeof(DekiScriptString) ); }
public void Can_call_ListApply() { _t.Test( "list.apply([1,2,3,4],\"$+$\")", "[ 2, 4, 6, 8 ]", typeof(DekiScriptList)); }
public void Definition_Assignment() { _dekiScriptTester.Test("var x = 5; let x = 10; x;", "10", typeof(DekiScriptNumber)); }
public void Abs() { _t.Test( @"Num.abs(-42);", @"42", typeof(DekiScriptNumber) ); }
public void AddDays() { _t.Test( @"Date.adddays(""01/01/2000"", 10);", @"Tue, 11 Jan 2000 00:00:00 GMT", typeof(DekiScriptString) ); }
public void AppendPath_String() { _t.Test( @"uri.appendpath(""http://www.mindtouch.com"", ""download"")", @"http://www.mindtouch.com/download", typeof(DekiScriptString) ); }
public void Cast() { _t.Test( @"String.cast(42);", @"42", typeof(DekiScriptString) ); }