Skip to content

Commit

Permalink
Fix engine tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pboyer committed Feb 9, 2018
1 parent 80089f3 commit f261df8
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions test/Engine/ProtoTest/TD/MultiLangTests/CollectionAssignment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3182,7 +3182,7 @@ public void T50_DictionaryInline()
String code =
@"
b=""x"";
a = {b : (b!=null)?4:-4};
a = {""x"" : (b!=null)?4:-4};
r = a [b];
";

Expand All @@ -3203,19 +3203,20 @@ public void T51_DictionaryInline_2()
ExecutionMirror mirror = thisTest.RunScriptSource(code);
thisTest.Verify("r", new object[] { 4, -4 });
}
[Test]

[Test, Category("Failure")]
public void T52_DictionaryKeynull()
{
// as per spec this is null as key is supported
String code =
@"
@"
b=null;
a = {b : 4};
r = a [b];
";

thisTest.RunAndVerifyRuntimeWarning(code, ProtoCore.Runtime.WarningID.InvalidArguments);
}

[Test]
public void T53_DictionaryKeyUpdate()
{
Expand All @@ -3224,16 +3225,16 @@ public void T53_DictionaryKeyUpdate()
@"
r = a[b];
b = ""y"";
a ={ b: 10};
a ={ ""y"": 10};
";

ExecutionMirror mirror = thisTest.RunScriptSource(code);
thisTest.Verify("r", 10);
}

[Test]
public void T54_DictionaryKeyUpdate_2()
{

String code =
@"
a = [1, 2, 3];
Expand All @@ -3257,8 +3258,7 @@ public void T59_DotOperator()
@"
def test(c:int)
{
b = ""x"";
a = {b : c};
a = {""x"" : c};
return = a;
}
Expand All @@ -3268,6 +3268,7 @@ def test(c:int)
ExecutionMirror mirror = thisTest.RunScriptSource(code);
thisTest.Verify("r", 5);
}

[Test, Category("Failure")]
[Category("DSDefinedClass_Ported")]
public void T60_DictionaryDotOperator()
Expand Down Expand Up @@ -3306,7 +3307,7 @@ public void T69_DictionaryDynamicArray()

}
[Test]
public void T70_DictionaryImeperativeWhile()
public void T70_DictionaryImperativeWhile()
{

String code =
Expand Down Expand Up @@ -3410,17 +3411,15 @@ def foo(z:test)
[Test]
public void T72_Dictionarytypeconversion()
{

// Dictionary expression keys not (yet) supported
String code =
@"
b = [""x"",""y""];
def foo(b1)
{
d = { b1: true};
return = d;
return Dictionary.ByKeysValues(b1, true);
}
z1 = foo(b);
x = z1[b];
Expand All @@ -3433,17 +3432,15 @@ def foo(b1)
[Test]
public void T73_Dictionaryrepguideszip()
{

// Dictionary expression keys not (yet) supported
String code =
@"
b = [""x"",""y""];
def foo(b1 : var)
{
a1 = { b1: true};
return = a1;
return Dictionary.ByKeysValues(b1, true);
}
z1 = foo(b < 1 >);
x = z1[0][b];
Expand Down

0 comments on commit f261df8

Please sign in to comment.