cuelang.org/go@v0.10.1/pkg/encoding/base64/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 "encoding/base64"
     5  
     6  t1: base64.Encode(null, "foo")
     7  t2: base64.Decode(null, base64.Encode(null, "foo"))
     8  t3: base64.Decode(null, "foo")
     9  t4: base64.Decode({}, "foo")
    10  -- out/base64 --
    11  Errors:
    12  t3: error in call to encoding/base64.Decode: illegal base64 data at input byte 0:
    13      ./in.cue:5:5
    14  t4: error in call to encoding/base64.Decode: base64: unsupported encoding: cannot use value {} (type struct) as null:
    15      ./in.cue:6:5
    16  
    17  Result:
    18  t1: "Zm9v"
    19  t2: 'foo'
    20  t3: _|_ // t3: error in call to encoding/base64.Decode: illegal base64 data at input byte 0
    21  t4: _|_ // t4: error in call to encoding/base64.Decode: base64: unsupported encoding: cannot use value {} (type struct) as null