Skip to content

Commit

Permalink
add test of sequential two edges
Browse files Browse the repository at this point in the history
Co-authored-by: Will Shanks <willshanks@us.ibm.com>
  • Loading branch information
nkanazawa1989 committed Sep 12, 2022
1 parent f579889 commit 1531480
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/python/pulse/test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,24 @@ def test_instruction_out_of_order_sequential(self):

self.assertNotEqual(block1, block2)

def test_instruction_out_of_order_sequential_more(self):
"""Test equality is False if three blocks have instructions in different order.
This could detect a particular bug as discussed in this thread:
https://github.com/Qiskit/qiskit-terra/pull/8005#discussion_r966191018
"""
block1 = pulse.ScheduleBlock(alignment_context=self.sequential_context)
block1 += pulse.Play(self.test_waveform0, self.d0)
block1 += pulse.Play(self.test_waveform0, self.d0)
block1 += pulse.Play(self.test_waveform0, self.d1)

block2 = pulse.ScheduleBlock(alignment_context=self.sequential_context)
block2 += pulse.Play(self.test_waveform0, self.d0)
block2 += pulse.Play(self.test_waveform0, self.d1)
block2 += pulse.Play(self.test_waveform0, self.d0)

self.assertNotEqual(block1, block2)

def test_instruction_in_order_sequential(self):
"""Test equality is True if two blocks have instructions in same order."""
block1 = pulse.ScheduleBlock(alignment_context=self.sequential_context)
Expand Down

0 comments on commit 1531480

Please sign in to comment.