MCPcopy Create free account
hub / github.com/riverqueue/river / TestUniqueOptsStateBitmask

Function TestUniqueOptsStateBitmask

internal/dbunique/db_unique_test.go:553–564  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

551}
552
553func TestUniqueOptsStateBitmask(t *testing.T) {
554 t.Parallel()
555
556 emptyOpts := &UniqueOpts{}
557 require.Equal(t, uniquestates.UniqueStatesToBitmask(uniqueOptsByStateDefault), emptyOpts.StateBitmask(), "Empty unique options should have default bitmask")
558
559 otherStates := []rivertype.JobState{rivertype.JobStateAvailable, rivertype.JobStateCompleted}
560 nonEmptyOpts := &UniqueOpts{
561 ByState: otherStates,
562 }
563 require.Equal(t, uniquestates.UniqueStatesToBitmask([]rivertype.JobState{rivertype.JobStateAvailable, rivertype.JobStateCompleted}), nonEmptyOpts.StateBitmask(), "Non-empty unique options should have correct bitmask")
564}

Callers

nothing calls this directly

Calls 2

StateBitmaskMethod · 0.95
UniqueStatesToBitmaskFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…