MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / TestValue_bytesToInt

Function TestValue_bytesToInt

internal/s3select/sql/value_test.go:218–366  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

216}
217
218func TestValue_bytesToInt(t *testing.T) {
219 type fields struct {
220 value interface{}
221 }
222 tests := []struct {
223 name string
224 fields fields
225 want int64
226 wantOK bool
227 }{
228 {
229 name: "zero",
230 fields: fields{
231 value: []byte("0"),
232 },
233 want: 0,
234 wantOK: true,
235 },
236 {
237 name: "minuszero",
238 fields: fields{
239 value: []byte("-0"),
240 },
241 want: 0,
242 wantOK: true,
243 },
244 {
245 name: "one",
246 fields: fields{
247 value: []byte("1"),
248 },
249 want: 1,
250 wantOK: true,
251 },
252 {
253 name: "minusone",
254 fields: fields{
255 value: []byte("-1"),
256 },
257 want: -1,
258 wantOK: true,
259 },
260 {
261 name: "plusone",
262 fields: fields{
263 value: []byte("+1"),
264 },
265 want: 1,
266 wantOK: true,
267 },
268 {
269 name: "max",
270 fields: fields{
271 value: []byte(strconv.FormatInt(math.MaxInt64, 10)),
272 },
273 want: math.MaxInt64,
274 wantOK: true,
275 },

Callers

nothing calls this directly

Calls 1

bytesToIntMethod · 0.95

Tested by

no test coverage detected