Example #1
0
        public void TV_ADD_StringNull()
        {
            String code =
                @"
                a = ""["" + null +""]"";
    
                "                                                                 ;

            thisTest.RunScriptSource(code);
            thisTest.SetErrorMessage("1467263 - Concatenating a string with an integer throws method resolution error");
            thisTest.Verify("a", "[null]");
        }
        public void T012_Inline_Using_Fun_Calls()
        {
            ExecutionMirror mirror = thisTest.RunScriptFile(testPath, "T012_Inline_Using_Fun_Calls.ds");
            Object          n1     = null;

            thisTest.SetErrorMessage("1467231 - Sprint 26 - Rev 3393 null to bool conversion should not be allowed");
            thisTest.Verify("x1", 1);
            thisTest.Verify("x2", 0);
            thisTest.Verify("x3", 0);
            thisTest.Verify("x4", 0);
            thisTest.Verify("x5", 0);
            thisTest.Verify("x6", 1);
            thisTest.Verify("x7", 0);
        }
Example #3
0
        public void TestStringOperations()
        {
            ExecutionMirror mirror = thisTest.RunScript(testCasePath + "TestStringOperations.ds");

            thisTest.SetErrorMessage("1467274 - Sprint26: rev3611: type conversion checking through two paths");
            thisTest.Verify("r1", "ab3");
            thisTest.Verify("r2", "abfalse");
            thisTest.Verify("r3", null);
            thisTest.Verify("r4", false);
            thisTest.Verify("r5", true);
            thisTest.Verify("r6", true);
            thisTest.Verify("r7", true);
            thisTest.Verify("r8", false);
            thisTest.Verify("r9", false);
            thisTest.Verify("ss", "xbc");
            thisTest.Verify("r10", null);
        }
Example #4
0
        public void T011_Defect_1467281_conditionals()
        {
            string code =
                @"x = 2 == { }; 
                 y = {}==null;
                 z = {{1}}=={1};
                 z2 = { { 1 } } == 1;
                 z3=1=={{1}};
                 z4={1}=={{1}};"                                                                                                                                                                     ;

            thisTest.RunScriptSource(code);
            thisTest.SetErrorMessage("1467281 Sprint 26 - Rev 3695 [Design Decision] incorrect conditional tests on empty arrays  ");
            thisTest.Verify("x", false); //WAITING FOR DESIGN DECISION
            thisTest.Verify("y", false); //WAITING FOR DESIGN DECISION
            thisTest.Verify("z", null);
            thisTest.Verify("z2", new object[] { new object[] { true } });
            thisTest.Verify("z3", new object[] { new object[] { true } });
            thisTest.Verify("z4", null);
        }
        public void T012_Inline_Using_Fun_Calls()
        {
            string          code   = @"
class A
{
    a : var;
	constructor A ( i : int)
	{
	    a = i;
	}
}
def power ( a )
{
    return = a * a ;
}
a = power(1);
b = power(0.5);
c = -1;
d = true;
f = null;
g = false;
h = A.A(1);
i = h.a;
x1 = power(power(2)) > power(2) ? power(1) : power(0);
x2 = power(power(2)) < power(2) ? power(1) : power(0);
x3 = power(c) < b ? power(1) : power(0);
x4 = power(f) >= power(1) ? power(1) : power(0);
x5 = power(f) < power(1) ? power(1) : power(0);
x6 = power(i) >= power(h.a) ? power(1) : power(0);
x7 = power(f) >= power(i) ? power(1) : power(0);
";
            ExecutionMirror mirror = thisTest.RunScriptSource(code);
            Object          n1     = null;

            thisTest.SetErrorMessage("1467231 - Sprint 26 - Rev 3393 null to bool conversion should not be allowed");
            thisTest.Verify("x1", 1);
            thisTest.Verify("x2", 0);
            thisTest.Verify("x3", 0);
            thisTest.Verify("x4", 0);
            thisTest.Verify("x5", 0);
            thisTest.Verify("x6", 1);
            thisTest.Verify("x7", 0);
        }
Example #6
0
        public void T011_Defect_1467281_conditionals()
        {
            // Tracked by http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-3941
            string code =
                @"x = 2 == { }; 
                 y = {}==null;
                 z = {{1}}=={1};
                 z2 = { { 1 } } == 1;
                 z3=1=={{1}};
                 z4={1}=={{1}};";

            thisTest.RunScriptSource(code);
            thisTest.SetErrorMessage("MAGN-3941 [Design Issue] Errors with conditionals with empty arrays and ararys with different ranks");
            thisTest.Verify("x", false); //WAITING FOR DESIGN DECISION
            thisTest.Verify("y", false); //WAITING FOR DESIGN DECISION
            thisTest.Verify("z", null);
            thisTest.Verify("z2", new object[] { new object[] { true } });
            thisTest.Verify("z3", new object[] { new object[] { true } });
            thisTest.Verify("z4", null);
        }
Example #7
0
        public void T053_Inherit_changevalue()
        {
            ExecutionMirror mirror = thisTest.RunScriptFile(testCasePath, "T053_Inherit_changevalue.ds");

            //Assert.Fail("1467246 - sprint25: rev 3445 : REGRESSION : Property setter/getter not working as expected for derived classes");
            thisTest.SetErrorMessage("1467183 - Sprint24: rev 3163 : replication on nested array is outputting extra brackets in some cases");

            object a = null;

            thisTest.Verify("x1", a);
            thisTest.Verify("x2", 1);
            thisTest.Verify("x3", true);
            thisTest.Verify("x4", 0.5);
            thisTest.Verify("x5", a);
            object [] arr = new object [] { 2, 2 };
            thisTest.Verify("x6", arr);
            object [] arr1 = new object [] { 0.5, 0.5 };
            thisTest.Verify("x7", arr1);
            object [] arr2 = new object [] { true, false };
            thisTest.Verify("x8", arr2);
            thisTest.Verify("x9", new object[] { null, null });
        }
        public void TestStringOperations()
        {
            string          code   = @"[Imperative]
{
	s = ""ab"";
	r1 = s + 3;
	r2 = s + false;
	r3 = s + null;
	r4 = !s;
	r5 = s == ""ab"";
	r6 = s == s;
	r7 = ""ab"" == ""ab"";
	ns = s;
	ns[0] = 1;
	r8 = ns == {1, 'b'};
	//r9 = """" == """";
	//r10 = ("""" == null);
    r9 = s != ""ab"";
    ss = ""abc"";
    ss[0] = 'x';
    r10 = """" == null;
}
";
            ExecutionMirror mirror = thisTest.RunScriptSource(code);

            thisTest.SetErrorMessage("1467274 - Sprint26: rev3611: type conversion checking through two paths");
            thisTest.Verify("r1", "ab3");
            thisTest.Verify("r2", "abfalse");
            thisTest.Verify("r3", null);
            thisTest.Verify("r4", false);
            thisTest.Verify("r5", true);
            thisTest.Verify("r6", true);
            thisTest.Verify("r7", true);
            thisTest.Verify("r8", false);
            thisTest.Verify("r9", false);
            thisTest.Verify("ss", "xbc");
            thisTest.Verify("r10", null);
        }