Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/Tests/IQsharpEngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,43 @@ operation RunTeleport() : Unit {
"compiled as an entry point for job execution."
)
));



}


/// <summary>
/// Tests for regression against
/// <see href="https://github.com/microsoft/iqsharp/issues/606">
/// microsoft/iqsharp#606
/// </see>.
/// </summary>
[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();
}
}
}
Expand Down