diff options
Diffstat (limited to 'mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs')
-rw-r--r-- | mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs b/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs index 9732b655d2..feb4294647 100644 --- a/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs +++ b/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs @@ -130,6 +130,22 @@ namespace MonoTests.EvaluatorTest Assert.AreEqual ("1+", sres, "The result should have been the input string, since we have a partial input"); } + [Test] + public void GotoWithUnreachableStatement () + { + Evaluator.Run ("using System;"); + + string code = "var x = new Action(() => {" + + "Console.WriteLine(\"beforeGoto\");" + + "goto L;" + + "L:" + + "Console.WriteLine(\"afterGoto\");" + + "});"; + + Assert.IsTrue (Evaluator.Run (code), "#1"); + Assert.IsTrue (Evaluator.Run ("x();"), "#2"); + } + #if NET_4_0 [Test] public void DynamicStatement () |