cirq.testing.OrderTester
Tests ordering against user-provided disjoint ordered groups or items.
cirq.testing.OrderTester()
Methods
add_ascending
View source
add_ascending(
*items
)
Tries to add a sequence of ascending items to the order tester.
This methods asserts that items must all be ascending
with regard to both each other and the elements which have been already
added during previous calls.
Some of the previously added elements might be equivalence groups,
which are supposed to be equal to each other within that group.
Args |
*items
|
The sequence of strictly ascending items.
|
Raises |
AssertionError
|
Items are not ascending either
with regard to each other, or with regard to the elements
which have been added before.
|
add_ascending_equivalence_group
View source
add_ascending_equivalence_group(
*group_items
)
Tries to add an ascending equivalence group to the order tester.
Asserts that the group items are equal to each other, but strictly
ascending with regard to the already added groups.
Adds the objects as a group.
Args |
*group_items
|
items making the equivalence group
|
Raises |
AssertionError
|
The group elements aren't equal to each other,
or items in another group overlap with the new group.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-06-27 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]