From 2c8fd9daecd99de5f2dc452499e53bebeafe769f Mon Sep 17 00:00:00 2001 From: Raphael Koh Date: Thu, 16 Jul 2020 16:56:05 -0400 Subject: [PATCH] Add test for operations with no qubits --- .../__tests__/ExecutionPathVisualizerTests/process.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Kernel/client/__tests__/ExecutionPathVisualizerTests/process.test.ts b/src/Kernel/client/__tests__/ExecutionPathVisualizerTests/process.test.ts index 894b7e52d2..bd9107c075 100644 --- a/src/Kernel/client/__tests__/ExecutionPathVisualizerTests/process.test.ts +++ b/src/Kernel/client/__tests__/ExecutionPathVisualizerTests/process.test.ts @@ -185,6 +185,13 @@ describe("Testing _groupOperations", () => { ]; expect(_groupOperations(operations, registers)).toEqual([[0], [0, 1], [1], []]); }); + test("no qubits", () => { + const operations: Operation[] = [ + { gate: "NoOp1", controlled: false, adjoint: false, controls: [], targets: [] }, + { gate: "NoOp2", controlled: false, adjoint: false, controls: [], targets: [] }, + ]; + expect(_groupOperations(operations, registers)).toEqual([[], [], [], []]); + }); }); describe("Testing _alignOps", () => {