cuelang.org/go@v0.10.1/pkg/strconv/testdata/gen.txtar (about)

     1  # generated from the original tests.
     2  # Henceforth it may be nicer to group tests into separate files.
     3  -- in.cue --
     4  import "strconv"
     5  
     6  t1: strconv.FormatUint(64, 16)
     7  t2: strconv.FormatFloat(3.02, 300, 4, 64)
     8  t3: strconv.FormatFloat(3.02, -1, 4, 64)
     9  t4: strconv.FormatFloat(3.02, 1.0, 4, 64)
    10  t5: strconv.FormatBool(true)
    11  t6: strconv.FormatInt(170_141_183_460_469_231_731_687_303_715_884_105_728, 10)
    12  t7: strconv.FormatInt(64, 16)
    13  t8: strconv.FormatUint(170_141_183_460_469_231_731_687_303_715_884_105_728, 10)
    14  t9: strconv.FormatUint(61, 62)
    15  t10: strconv.FormatFloat(0.0, 102, -1, 64)
    16  -- out/strconv --
    17  Errors:
    18  t2: int 300 overflows byte in argument 1 in call to strconv.FormatFloat:
    19      ./in.cue:4:5
    20  t3: cannot use -1 (type int) as byte in argument 1 to strconv.FormatFloat:
    21      ./in.cue:5:5
    22      ./in.cue:5:31
    23  t4: cannot use 1.0 (type float) as int in argument 2 to strconv.FormatFloat:
    24      ./in.cue:6:31
    25  
    26  Result:
    27  t1:  "40"
    28  t2:  _|_ // t2: int 300 overflows byte in argument 1 in call to strconv.FormatFloat
    29  t3:  _|_ // t3: cannot use -1 (type int) as byte in argument 1 to strconv.FormatFloat
    30  t4:  _|_ // t4: cannot use 1.0 (type float) as int in argument 2 to strconv.FormatFloat
    31  t5:  "true"
    32  t6:  "170141183460469231731687303715884105728"
    33  t7:  "40"
    34  t8:  "170141183460469231731687303715884105728"
    35  t9:  "Z"
    36  t10: "0"