...

Text file src/cuelang.org/go/pkg/strconv/testdata/gen.txtar

Documentation: cuelang.org/go/pkg/strconv/testdata

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

View as plain text