github.com/drone/go-convert@v0.0.0-20240307072510-6bd371c65e61/convert/jenkins/convert_test.go (about)

     1  // Copyright 2022 Harness, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  package jenkins
    15  
    16  import "testing"
    17  
    18  func TestConvert(t *testing.T) {
    19  	t.Skip()
    20  }
    21  
    22  func TestExtractCodeFence(t *testing.T) {
    23  	tests := []struct {
    24  		before string
    25  		after  string
    26  	}{
    27  		{
    28  			before: "foo ```bar``` baz",
    29  			after:  "bar",
    30  		},
    31  		{
    32  			before: "foo ```bar",
    33  			after:  "bar",
    34  		},
    35  		{
    36  			before: "bar```",
    37  			after:  "bar",
    38  		},
    39  		{
    40  			before: "bar",
    41  			after:  "bar",
    42  		},
    43  	}
    44  	for i, test := range tests {
    45  		if got, want := extractCodeFence(test.before), test.after; got != want {
    46  			t.Errorf("Want code %q got %q at index %d", want, got, i)
    47  		}
    48  	}
    49  }