1 // Copyright 2021 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 // Check that the partial order in lockPartialOrder fits within the total order
13 // determined by the order of the lockRank constants.
14 func TestLockRankPartialOrder(t
*testing
.T
) {
15 for r
, list
:= range LockPartialOrder
{
17 for _
, e
:= range list
{
20 t
.Errorf("lockPartialOrder row %v entry %v is inconsistent with total lock ranking order", rank
, entry
)
26 // Verify that partial order lists are kept sorted. This is a purely cosemetic
27 // check to make manual reviews simpler. It does not affect correctness, unlike
29 func TestLockRankPartialOrderSortedEntries(t
*testing
.T
) {
30 for r
, list
:= range LockPartialOrder
{
33 for _
, e
:= range list
{
36 t
.Errorf("Partial order for rank %v out of order: %v <= %v in %v", rank
, entry
, prev
, list
)