diff --git a/src/Tests/IQsharpEngineTests.cs b/src/Tests/IQsharpEngineTests.cs index 946da4557d..057fd407c9 100644 --- a/src/Tests/IQsharpEngineTests.cs +++ b/src/Tests/IQsharpEngineTests.cs @@ -951,6 +951,43 @@ operation RunTeleport() : Unit { "compiled as an entry point for job execution." ) )); + + + + } + + + /// + /// Tests for regression against + /// + /// microsoft/iqsharp#606 + /// . + /// + [TestMethod] + public async Task CompileAndSimulateWithLambdas() + { + const string source = @" + function Foo() : Unit { + let f = x -> x; + let y = f(12); + } + + operation DoBar() : Unit { + let u = (q) => H(q); + use q = Qubit(); + H(q); + u(q); + } + "; + + var engineInput = await Assert.That + .UsingEngine() + .Input(source) + .ExecutesSuccessfully() + .Input("%simulate Foo") + .ExecutesSuccessfully() + .Input("%simulate DoBar") + .ExecutesSuccessfully(); } } }