github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/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  -- out/strconv --
    12  Errors:
    13  t2: int 300 overflows byte in argument 1 in call to strconv.FormatFloat:
    14      ./in.cue:4:5
    15  t3: cannot use -1 (type int) as byte in argument 1 to strconv.FormatFloat:
    16      ./in.cue:5:5
    17      ./in.cue:5:31
    18  t4: cannot use 1.0 (type float) as int in argument 2 to strconv.FormatFloat:
    19      ./in.cue:6:31
    20  
    21  Result:
    22  t1: "40"
    23  t2: _|_ // t2: int 300 overflows byte in argument 1 in call to strconv.FormatFloat
    24  t3: _|_ // t3: cannot use -1 (type int) as byte in argument 1 to strconv.FormatFloat
    25  t4: _|_ // t4: cannot use 1.0 (type float) as int in argument 2 to strconv.FormatFloat
    26  t5: "true"
    27