github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: json Marshaling detects incomplete
     4  #evalFull
     5  -- in.cue --
     6  import "encoding/json"
     7  
     8  a: json.Marshal({a: string})
     9  
    10  foo: {a: 3, b: foo.c}
    11  b: json.Marshal(foo)
    12  -- out/def --
    13  import "encoding/json"
    14  
    15  a: json.Marshal({
    16  	a: string
    17  })
    18  foo: {
    19  	a: 3
    20  	b: foo.c
    21  }
    22  b: json.Marshal(foo)
    23  -- out/legacy-debug --
    24  <0>{a: <1>.Marshal (<2>{a: string}), foo: <3>{a: 3, b: <4>.foo.c}, b: <1>.Marshal (<4>.foo)}
    25  -- out/eval --
    26  (struct){
    27    a: (_|_){
    28      // [incomplete] cannot convert incomplete value "string" to JSON:
    29      //     ./in.cue:3:21
    30    }
    31    foo: (struct){
    32      a: (int){ 3 }
    33      b: (_|_){
    34        // [incomplete] foo.b: undefined field: c:
    35        //     ./in.cue:5:20
    36      }
    37    }
    38    b: (_|_){
    39      // [incomplete] foo.b: undefined field: c:
    40      //     ./in.cue:5:20
    41    }
    42  }
    43  -- out/compile --
    44  --- in.cue
    45  {
    46    a: 〈import;"encoding/json"〉.Marshal({
    47      a: string
    48    })
    49    foo: {
    50      a: 3
    51      b: 〈1;foo〉.c
    52    }
    53    b: 〈import;"encoding/json"〉.Marshal(〈0;foo〉)
    54  }