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

Function TestValue_bytesToFloat

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

Source from the content-addressed store, hash-verified

366}
367
368func TestValue_bytesToFloat(t *testing.T) {
369 type fields struct {
370 value interface{}
371 }
372 tests := []struct {
373 name string
374 fields fields
375 want float64
376 wantOK bool
377 }{
378 // Copied from TestValue_bytesToInt.
379 {
380 name: "zero",
381 fields: fields{
382 value: []byte("0"),
383 },
384 want: 0,
385 wantOK: true,
386 },
387 {
388 name: "minuszero",
389 fields: fields{
390 value: []byte("-0"),
391 },
392 want: 0,
393 wantOK: true,
394 },
395 {
396 name: "one",
397 fields: fields{
398 value: []byte("1"),
399 },
400 want: 1,
401 wantOK: true,
402 },
403 {
404 name: "minusone",
405 fields: fields{
406 value: []byte("-1"),
407 },
408 want: -1,
409 wantOK: true,
410 },
411 {
412 name: "plusone",
413 fields: fields{
414 value: []byte("+1"),
415 },
416 want: 1,
417 wantOK: true,
418 },
419 {
420 name: "maxint",
421 fields: fields{
422 value: []byte(strconv.FormatInt(math.MaxInt64, 10)),
423 },
424 want: math.MaxInt64,
425 wantOK: true,

Callers

nothing calls this directly

Calls 1

bytesToFloatMethod · 0.95

Tested by

no test coverage detected