Commit 2e8fcf3
committed
🧪 [testing improvement] Add error path test for invalid number of target qubits in add_op_to_circuit
Addresses a testing gap in `qsimcirq/qsim_circuit.py` where the `NotImplementedError` for controlled gates with more than 4 target qubits was not explicitly tested.
🎯 **What:** The testing gap addressed
- Added `test_add_op_to_circuit_too_many_targets` to `qsimcirq_tests/qsimcirq_test.py`.
📊 **Coverage:** What scenarios are now tested
- Controlled gates with more than 4 target qubits (specifically 5 targets) are now verified to raise `NotImplementedError` with the correct error message.
✨ **Result:** The improvement in test coverage
- Increased reliability of the `add_op_to_circuit` function by covering a previously untested error path.1 parent a78d121 commit 2e8fcf3
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
882 | 899 | | |
883 | 900 | | |
884 | 901 | | |
| |||
0 commit comments