github.com/newrelic/go-agent@v3.26.0+incompatible/internal/priority_test.go (about)

     1  // Copyright 2020 New Relic Corporation. All rights reserved.
     2  // SPDX-License-Identifier: Apache-2.0
     3  
     4  package internal
     5  
     6  import (
     7  	"testing"
     8  )
     9  
    10  func TestIsLowerPriority(t *testing.T) {
    11  	low := Priority(0.0)
    12  	middle := Priority(0.1)
    13  	high := Priority(0.999999)
    14  
    15  	if !low.isLowerPriority(middle) {
    16  		t.Error(low, middle)
    17  	}
    18  
    19  	if high.isLowerPriority(middle) {
    20  		t.Error(high, middle)
    21  	}
    22  
    23  	if high.isLowerPriority(high) {
    24  		t.Error(high, high)
    25  	}
    26  }