...

Text file src/cuelang.org/go/cue/testdata/fulleval/005_conditional_field.txtar

Documentation: cuelang.org/go/cue/testdata/fulleval

     1# DO NOT EDIT; generated by go run testdata/gen.go
     2#
     3#name: conditional field
     4#evalFull
     5-- in.cue --
     6
     7if b {
     8	a: "foo"
     9}
    10b: true
    11c: {
    12	a: 3
    13	if a > 1 {
    14		a: 3
    15	}
    16}
    17d: {
    18	a: int
    19	if a > 1 {
    20		a: 3
    21	}
    22}
    23-- out/def --
    24b: true
    25a: "foo"
    26c: {
    27	a: 3
    28}
    29d: {
    30	a: int
    31	if a > 1 {
    32		a: 3
    33	}
    34}
    35-- out/legacy-debug --
    36<0>{b: true, a: "foo", c: <1>{a: 3}, d: <2>{a: int if (<3>.a > 1) yield <4>{a: 3}}}
    37-- out/compile --
    38--- in.cue
    39{
    40  if 〈0;b〉 {
    41    a: "foo"
    42  }
    43  b: true
    44  c: {
    45    a: 3
    46    if (〈0;a〉 > 1) {
    47      a: 3
    48    }
    49  }
    50  d: {
    51    a: int
    52    if (〈0;a〉 > 1) {
    53      a: 3
    54    }
    55  }
    56}
    57-- out/eval/stats --
    58Leaks:  0
    59Freed:  7
    60Reused: 4
    61Allocs: 3
    62Retain: 1
    63
    64Unifications: 7
    65Conjuncts:    7
    66Disjuncts:    7
    67-- out/evalalpha --
    68(struct){
    69  a: (string){ "foo" }
    70  b: (bool){ true }
    71  c: (struct){
    72    a: (int){ 3 }
    73  }
    74  d: (_|_){
    75    // [incomplete] d: non-concrete value int in operand to >:
    76    //     ./in.cue:14:5
    77    //     ./in.cue:13:5
    78    a: (_|_){
    79      // [incomplete] d: non-concrete value int in operand to >:
    80      //     ./in.cue:14:5
    81      //     ./in.cue:13:5
    82    }
    83  }
    84}
    85-- diff/-out/evalalpha<==>+out/eval --
    86diff old new
    87--- old
    88+++ new
    89@@ -5,11 +5,13 @@
    90     a: (int){ 3 }
    91   }
    92   d: (_|_){
    93-    // [cycle] cycle error:
    94+    // [incomplete] d: non-concrete value int in operand to >:
    95     //     ./in.cue:14:5
    96+    //     ./in.cue:13:5
    97     a: (_|_){
    98-      // [cycle] cycle error:
    99+      // [incomplete] d: non-concrete value int in operand to >:
   100       //     ./in.cue:14:5
   101+      //     ./in.cue:13:5
   102     }
   103   }
   104 }
   105-- diff/explanation --
   106Improved error message.
   107-- out/eval --
   108(struct){
   109  a: (string){ "foo" }
   110  b: (bool){ true }
   111  c: (struct){
   112    a: (int){ 3 }
   113  }
   114  d: (_|_){
   115    // [cycle] cycle error:
   116    //     ./in.cue:14:5
   117    a: (_|_){
   118      // [cycle] cycle error:
   119      //     ./in.cue:14:5
   120    }
   121  }
   122}

View as plain text