github.com/google/syzkaller@v0.0.0-20251211124644-a066d2bc4b02/pkg/signal/signal_test.go (about)

     1  // Copyright 2024 syzkaller project authors. All rights reserved.
     2  // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  package signal
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/assert"
    10  )
    11  
    12  func TestIntersectsWith(t *testing.T) {
    13  	base := FromRaw([]uint64{0, 1, 2, 3, 4}, 1)
    14  	assert.True(t, base.IntersectsWith(FromRaw([]uint64{0, 5, 10}, 1)))
    15  	assert.False(t, base.IntersectsWith(FromRaw([]uint64{5, 10, 15}, 1)))
    16  	// The other signal has a lower priority.
    17  	assert.False(t, base.IntersectsWith(FromRaw([]uint64{0, 1, 2}, 0)))
    18  }