Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@ -146,7 +146,15 @@ namespace MonoTests.EvaluatorTest
Assert.IsTrue (Evaluator.Run ("x();"), "#2");
}
#if NET_4_0
[Test]
public void CapturedLocalVariable ()
{
Evaluator.Run ("using System;");
var res = Evaluator.Evaluate("var x = 123; Action a = () => x++; a(); x;");
Assert.AreEqual (124, res);
}
[Test]
public void DynamicStatement ()
{
@ -154,9 +162,7 @@ namespace MonoTests.EvaluatorTest
Evaluator.Run ("d = 'a';");
Evaluator.Run ("d.GetType ();");
}
#endif
#if NET_4_5
[Test]
public void AwaitExpression ()
{
@ -165,6 +171,14 @@ namespace MonoTests.EvaluatorTest
res = Evaluator.Evaluate ("res;");
Assert.AreEqual (3, res, "#1");
}
#endif
[Test]
public void UsingStatic ()
{
Evaluator.Run ("using static System.String;");
var res = Evaluator.Evaluate("Join (\"--\", new [] { \"a\", \"b\" } );");
Assert.AreEqual ("a--b", res);
}
}
}