@@ -74,30 +74,6 @@ func TestRunCLICommandCapsOutput(t *testing.T) {
7474 }
7575}
7676
77- func TestBoundedBufferDiscardsExcessBytes (t * testing.T ) {
78- truncations := 0
79- buffer := newBoundedBuffer (5 , func () {
80- truncations ++
81- })
82- written , err := buffer .Write ([]byte ("abcdefgh" ))
83- if err != nil {
84- t .Fatalf ("Write() error = %v" , err )
85- }
86- if written != 8 {
87- t .Fatalf ("Write() = %d, want 8" , written )
88- }
89- if got := buffer .String (); got != "abcde" {
90- t .Fatalf ("buffer = %q, want abcde" , got )
91- }
92- if ! buffer .Truncated () {
93- t .Fatal ("buffer did not record truncation" )
94- }
95- _ , _ = buffer .Write ([]byte ("more" ))
96- if truncations != 1 {
97- t .Fatalf ("truncation callback invoked %d times, want once" , truncations )
98- }
99- }
100-
10177func TestRunCLICommandCapturesStdoutVariables (t * testing.T ) {
10278 variables := map [string ]string {}
10379 result := runCLICommand (api.CLIStepCLICommand {
@@ -178,21 +154,6 @@ func TestRunCLICommandInterpolatesCapturedStdoutVariables(t *testing.T) {
178154 }
179155}
180156
181- func TestParseStdoutVariablesRequiresOneCaptureGroup (t * testing.T ) {
182- variables := map [string ]string {}
183- err := parseStdoutVariables ("token=abc123" , []api.CLICommandStdoutVariable {{
184- Name : "token" ,
185- Regex : `token=([a-z]+)([0-9]+)` ,
186- }}, variables )
187-
188- if err == nil {
189- t .Fatal ("expected parse error" )
190- }
191- if err .Error () != "invalid stdout variable configuration" {
192- t .Fatalf ("error = %q, want invalid stdout variable configuration" , err .Error ())
193- }
194- }
195-
196157func TestParseStdoutVariablesUsesGenericConfigurationError (t * testing.T ) {
197158 tests := []struct {
198159 name string
0 commit comments