...

Source file src/github.com/letsencrypt/boulder/cmd/rocsp-tool/inflight_test.go

Documentation: github.com/letsencrypt/boulder/cmd/rocsp-tool

     1  package notmain
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/letsencrypt/boulder/test"
     7  )
     8  
     9  func TestInflight(t *testing.T) {
    10  	ifl := newInflight()
    11  	test.AssertEquals(t, ifl.len(), 0)
    12  	test.AssertEquals(t, ifl.min(), uint64(0))
    13  
    14  	ifl.add(1337)
    15  	test.AssertEquals(t, ifl.len(), 1)
    16  	test.AssertEquals(t, ifl.min(), uint64(1337))
    17  
    18  	ifl.remove(1337)
    19  	test.AssertEquals(t, ifl.len(), 0)
    20  	test.AssertEquals(t, ifl.min(), uint64(0))
    21  
    22  	ifl.add(7341)
    23  	ifl.add(3317)
    24  	ifl.add(1337)
    25  	test.AssertEquals(t, ifl.len(), 3)
    26  	test.AssertEquals(t, ifl.min(), uint64(1337))
    27  
    28  	ifl.remove(3317)
    29  	ifl.remove(1337)
    30  	ifl.remove(7341)
    31  	test.AssertEquals(t, ifl.len(), 0)
    32  	test.AssertEquals(t, ifl.min(), uint64(0))
    33  }
    34  

View as plain text