| 1 | /* |
| 2 | Copyright 2025 The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package helpersscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/ |
| 18 | |
| 19 | import ( |
| 20 | "bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/" |
| 21 | "osscip-go gomod github.com/golang/go/src go1.24.0 os/" |
| 22 | "path/filepathscip-go gomod github.com/golang/go/src go1.24.0 `path/filepath`/" |
| 23 | "testingscip-go gomod github.com/golang/go/src go1.24.0 testing/" |
| 24 | |
| 25 | "github.com/olekukonko/tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/" |
| 26 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/" |
| 27 | ) |
| 28 | |
| 29 | // compareGolden compares actual output with golden file. |
| 30 | func compareGoldenscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/compareGolden().(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#, actual, goldenFile string) { |
| 31 | t.Helperscip-go gomod github.com/golang/go/src go1.24.0 testing/common#Helper().() |
| 32 | |
| 33 | goldenPath := filepathscip-go gomod github.com/golang/go/src go1.24.0 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.0 `path/filepath`/Join().("testdata", goldenFile) |
| 34 | expected, err := osscip-go gomod github.com/golang/go/src go1.24.0 os/.ReadFilescip-go gomod github.com/golang/go/src go1.24.0 os/ReadFile().(goldenPath) |
| 35 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err, "Failed to read golden file: %s", goldenPath) |
| 36 | |
| 37 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Equal().(t, string(expected), actual, "Output doesn't match golden file: %s", goldenFile) |
| 38 | } |
| 39 | |
| 40 | func TestNewTableWriterscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/TestNewTableWriter().(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 41 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 42 | |
| 43 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("NoOptions", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 44 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 45 | |
| 46 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 47 | |
| 48 | table := NewTableWriterscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriter().(&output) |
| 49 | |
| 50 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 51 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 52 | |
| 53 | table.Headerscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Header().("Name", "Age") |
| 54 | _ = table.Appendscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Append().([]string{"John", "30"}) |
| 55 | _ = table.Renderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Render().() |
| 56 | |
| 57 | compareGoldenscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/compareGolden().(t, output.Stringscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#String().(), "no_options.golden") |
| 58 | }) |
| 59 | |
| 60 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("WithSingleOption", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 61 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 62 | |
| 63 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 64 | |
| 65 | table := NewTableWriterscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriter().(&output, tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.WithMaxWidthscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/WithMaxWidth().(80)) |
| 66 | |
| 67 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 68 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 69 | |
| 70 | table.Headerscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Header().("Name", "Age") |
| 71 | _ = table.Appendscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Append().([]string{"John", "30"}) |
| 72 | _ = table.Renderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Render().() |
| 73 | |
| 74 | compareGoldenscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/compareGolden().(t, output.Stringscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#String().(), "with_single_option.golden") |
| 75 | }) |
| 76 | |
| 77 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("WithMultipleOptions", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 78 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 79 | |
| 80 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 81 | |
| 82 | table := NewTableWriterscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriter().(&output, |
| 83 | tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.WithHeaderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/WithHeader().([]string{"Name", "Age"}), |
| 84 | tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.WithMaxWidthscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/WithMaxWidth().(80), |
| 85 | ) |
| 86 | |
| 87 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 88 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 89 | |
| 90 | _ = table.Appendscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Append().([]string{"John", "30"}) |
| 91 | _ = table.Renderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Render().() |
| 92 | |
| 93 | compareGoldenscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/compareGolden().(t, output.Stringscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#String().(), "with_multiple_options.golden") |
| 94 | }) |
| 95 | |
| 96 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("WithHeaderOption", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 97 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 98 | |
| 99 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 100 | |
| 101 | table := NewTableWriterscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriter().(&output, tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.WithHeaderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/WithHeader().([]string{"Name", "Age"})) |
| 102 | |
| 103 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 104 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 105 | |
| 106 | _ = table.Appendscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Append().([]string{"John", "30"}) |
| 107 | _ = table.Renderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Render().() |
| 108 | |
| 109 | compareGoldenscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/compareGolden().(t, output.Stringscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#String().(), "with_header_option.golden") |
| 110 | }) |
| 111 | |
| 112 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("WithFooterOption", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 113 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 114 | |
| 115 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 116 | |
| 117 | table := NewTableWriterscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriter().(&output, tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.WithFooterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/WithFooter().([]string{"Total", "1"})) |
| 118 | |
| 119 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 120 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 121 | |
| 122 | table.Headerscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Header().("Name", "Age") |
| 123 | _ = table.Appendscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Append().([]string{"John", "30"}) |
| 124 | _ = table.Renderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Render().() |
| 125 | |
| 126 | compareGoldenscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/compareGolden().(t, output.Stringscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#String().(), "with_footer_option.golden") |
| 127 | }) |
| 128 | |
| 129 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("EmptyTable", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 130 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 131 | |
| 132 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 133 | |
| 134 | table := NewTableWriterscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriter().(&output) |
| 135 | |
| 136 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 137 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 138 | |
| 139 | table.Headerscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Header().("Name", "Age") |
| 140 | _ = table.Renderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Render().() |
| 141 | |
| 142 | compareGoldenscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/compareGolden().(t, output.Stringscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#String().(), "empty_table.golden") |
| 143 | }) |
| 144 | |
| 145 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("MultipleRows", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 146 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 147 | |
| 148 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 149 | |
| 150 | table := NewTableWriterscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriter().(&output) |
| 151 | |
| 152 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 153 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 154 | |
| 155 | table.Headerscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Header().("Name", "Age", "City") |
| 156 | _ = table.Appendscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Append().([]string{"John", "30", "New York"}) |
| 157 | _ = table.Appendscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Append().([]string{"Jane", "25", "Boston"}) |
| 158 | _ = table.Appendscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Append().([]string{"Bob", "35", "Chicago"}) |
| 159 | _ = table.Renderscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#Render().() |
| 160 | |
| 161 | compareGoldenscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/compareGolden().(t, output.Stringscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#String().(), "multiple_rows.golden") |
| 162 | }) |
| 163 | } |
| 164 | |
| 165 | func TestNewTableWriterWithDefaultsscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/TestNewTableWriterWithDefaults().(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 166 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 167 | |
| 168 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("WithDefaults", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 169 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 170 | |
| 171 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 172 | |
| 173 | table := NewTableWriterWithDefaultsscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriterWithDefaults().(&output) |
| 174 | |
| 175 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 176 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 177 | }) |
| 178 | |
| 179 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("WithDefaultsAndHeader", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 180 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 181 | |
| 182 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 183 | |
| 184 | header := []string{"TESTGRID BOARD", "TITLE", "STATUS", "STATUS DETAILS"} |
| 185 | table := NewTableWriterWithDefaultsAndHeaderscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriterWithDefaultsAndHeader().(&output, header) |
| 186 | |
| 187 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 188 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 189 | }) |
| 190 | |
| 191 | t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().("WithDefaultsAndAdditionalOptions", func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) { |
| 192 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Parallel().() |
| 193 | |
| 194 | var output bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer# |
| 195 | |
| 196 | table := NewTableWriterWithDefaultsscip-go gomod sigs.k8s.io/release-utils . `sigs.k8s.io/release-utils/helpers`/NewTableWriterWithDefaults().(&output, tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.WithMaxWidthscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/WithMaxWidth().(100)) |
| 197 | |
| 198 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, table) |
| 199 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.IsTypescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/IsType().(t, &tablewriterscip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/.Tablescip-go gomod github.com/olekukonko/tablewriter v1.1.0 `github.com/olekukonko/tablewriter`/Table#{}, table) |
| 200 | }) |
| 201 | } |