cuelang.org/go@v0.10.1/cue/testdata/disjunctions/incomplete.txtar (about)

     1  -- in.cue --
     2  import "encoding/yaml"
     3  
     4  issue700: {
     5  	a: y: "y"
     6  	test1: *a.x | 1
     7  	test2: *a.y | 1
     8  }
     9  
    10  lookup: {
    11  	x: {
    12  		name: "Hello"
    13  	}
    14  	y:        x.a
    15  	ok1:      *x.a | x
    16  	ok2:      x | *x.a
    17  	ok3:      x.a | *x
    18  	ok4:      *x | x.a
    19  	ok5:      x | x.a
    20  	ok5:      x.a | x
    21  	allFail1: x.a | x.b
    22  	allFail2: x.a | x.b
    23  }
    24  
    25  func: {
    26  	s:   string
    27  	ok1: yaml.MarshalStream(s) | yaml.Marshal(s)
    28  }
    29  
    30  issue782: {
    31  	a: {
    32  		inner:         string
    33  		interpolation: *"\(inner)" | string
    34  		interpolation: "override"
    35  	}
    36  	b: {
    37  		inner:         string
    38  		interpolation: string | *"\(inner)"
    39  		interpolation: "override"
    40  	}
    41  	c: {
    42  		inner:         string
    43  		interpolation: "\(inner)" | string
    44  		interpolation: "override"
    45  	}
    46  	d: {
    47  		inner:         string
    48  		interpolation: string | "\(inner)"
    49  		interpolation: "override"
    50  	}
    51  }
    52  -- out/eval/stats --
    53  Leaks:  0
    54  Freed:  70
    55  Reused: 64
    56  Allocs: 6
    57  Retain: 0
    58  
    59  Unifications: 40
    60  Conjuncts:    99
    61  Disjuncts:    70
    62  -- out/evalalpha --
    63  (struct){
    64    issue700: (struct){
    65      a: (struct){
    66        y: (string){ "y" }
    67      }
    68      test1: (int){ 1 }
    69      test2: ((int|string)){ |(*(string){ "y" }, (int){ 1 }) }
    70    }
    71    lookup: (struct){
    72      x: (struct){
    73        name: (string){ "Hello" }
    74      }
    75      y: (_|_){
    76        // [incomplete] lookup.y: undefined field: a:
    77        //     ./in.cue:13:14
    78      }
    79      ok1: (struct){
    80        name: (string){ "Hello" }
    81      }
    82      ok2: (struct){
    83        name: (string){ "Hello" }
    84      }
    85      ok3: (struct){
    86        name: (string){ "Hello" }
    87      }
    88      ok4: (struct){
    89        name: (string){ "Hello" }
    90      }
    91      ok5: (struct){
    92        name: (string){ "Hello" }
    93      }
    94      allFail1: (_|_){
    95        // [incomplete] lookup.allFail1: undefined field: a:
    96        //     ./in.cue:20:14
    97        // lookup.allFail1: undefined field: b:
    98        //     ./in.cue:20:20
    99      }
   100      allFail2: (_|_){
   101        // [incomplete] lookup.allFail2: undefined field: a:
   102        //     ./in.cue:21:14
   103        // lookup.allFail2: undefined field: b:
   104        //     ./in.cue:21:20
   105      }
   106    }
   107    func: (struct){
   108      s: (string){ string }
   109      ok1: (_|_){
   110        // [incomplete] func.ok1: non-concrete argument 0:
   111        //     ./in.cue:26:7
   112        // func.ok1: non-concrete argument 0:
   113        //     ./in.cue:26:31
   114      }
   115    }
   116    issue782: (struct){
   117      a: (struct){
   118        inner: (string){ string }
   119        interpolation: (string){ "override" }
   120      }
   121      b: (struct){
   122        inner: (string){ string }
   123        interpolation: (string){ "override" }
   124      }
   125      c: (struct){
   126        inner: (string){ string }
   127        interpolation: (string){ "override" }
   128      }
   129      d: (struct){
   130        inner: (string){ string }
   131        interpolation: (string){ "override" }
   132      }
   133    }
   134  }
   135  -- diff/-out/evalalpha<==>+out/eval --
   136  diff old new
   137  --- old
   138  +++ new
   139  @@ -30,15 +30,13 @@
   140         name: (string){ "Hello" }
   141       }
   142       allFail1: (_|_){
   143  -      // [incomplete] lookup.allFail1: 2 errors in empty disjunction:
   144  -      // lookup.allFail1: undefined field: a:
   145  +      // [incomplete] lookup.allFail1: undefined field: a:
   146         //     ./in.cue:20:14
   147         // lookup.allFail1: undefined field: b:
   148         //     ./in.cue:20:20
   149       }
   150       allFail2: (_|_){
   151  -      // [incomplete] lookup.allFail2: 2 errors in empty disjunction:
   152  -      // lookup.allFail2: undefined field: a:
   153  +      // [incomplete] lookup.allFail2: undefined field: a:
   154         //     ./in.cue:21:14
   155         // lookup.allFail2: undefined field: b:
   156         //     ./in.cue:21:20
   157  @@ -47,8 +45,7 @@
   158     func: (struct){
   159       s: (string){ string }
   160       ok1: (_|_){
   161  -      // [incomplete] func.ok1: 2 errors in empty disjunction:
   162  -      // func.ok1: non-concrete argument 0:
   163  +      // [incomplete] func.ok1: non-concrete argument 0:
   164         //     ./in.cue:26:7
   165         // func.ok1: non-concrete argument 0:
   166         //     ./in.cue:26:31
   167  -- diff/todo/p2 --
   168  Missing "X errors in empty disjunction"
   169  -- out/eval --
   170  (struct){
   171    issue700: (struct){
   172      a: (struct){
   173        y: (string){ "y" }
   174      }
   175      test1: (int){ 1 }
   176      test2: ((int|string)){ |(*(string){ "y" }, (int){ 1 }) }
   177    }
   178    lookup: (struct){
   179      x: (struct){
   180        name: (string){ "Hello" }
   181      }
   182      y: (_|_){
   183        // [incomplete] lookup.y: undefined field: a:
   184        //     ./in.cue:13:14
   185      }
   186      ok1: (struct){
   187        name: (string){ "Hello" }
   188      }
   189      ok2: (struct){
   190        name: (string){ "Hello" }
   191      }
   192      ok3: (struct){
   193        name: (string){ "Hello" }
   194      }
   195      ok4: (struct){
   196        name: (string){ "Hello" }
   197      }
   198      ok5: (struct){
   199        name: (string){ "Hello" }
   200      }
   201      allFail1: (_|_){
   202        // [incomplete] lookup.allFail1: 2 errors in empty disjunction:
   203        // lookup.allFail1: undefined field: a:
   204        //     ./in.cue:20:14
   205        // lookup.allFail1: undefined field: b:
   206        //     ./in.cue:20:20
   207      }
   208      allFail2: (_|_){
   209        // [incomplete] lookup.allFail2: 2 errors in empty disjunction:
   210        // lookup.allFail2: undefined field: a:
   211        //     ./in.cue:21:14
   212        // lookup.allFail2: undefined field: b:
   213        //     ./in.cue:21:20
   214      }
   215    }
   216    func: (struct){
   217      s: (string){ string }
   218      ok1: (_|_){
   219        // [incomplete] func.ok1: 2 errors in empty disjunction:
   220        // func.ok1: non-concrete argument 0:
   221        //     ./in.cue:26:7
   222        // func.ok1: non-concrete argument 0:
   223        //     ./in.cue:26:31
   224      }
   225    }
   226    issue782: (struct){
   227      a: (struct){
   228        inner: (string){ string }
   229        interpolation: (string){ "override" }
   230      }
   231      b: (struct){
   232        inner: (string){ string }
   233        interpolation: (string){ "override" }
   234      }
   235      c: (struct){
   236        inner: (string){ string }
   237        interpolation: (string){ "override" }
   238      }
   239      d: (struct){
   240        inner: (string){ string }
   241        interpolation: (string){ "override" }
   242      }
   243    }
   244  }
   245  -- out/compile --
   246  --- in.cue
   247  {
   248    issue700: {
   249      a: {
   250        y: "y"
   251      }
   252      test1: (*〈0;a〉.x|1)
   253      test2: (*〈0;a〉.y|1)
   254    }
   255    lookup: {
   256      x: {
   257        name: "Hello"
   258      }
   259      y: 〈0;x〉.a
   260      ok1: (*〈0;x〉.a|〈0;x〉)
   261      ok2: (〈0;x〉|*〈0;x〉.a)
   262      ok3: (〈0;x〉.a|*〈0;x〉)
   263      ok4: (*〈0;x〉|〈0;x〉.a)
   264      ok5: (〈0;x〉|〈0;x〉.a)
   265      ok5: (〈0;x〉.a|〈0;x〉)
   266      allFail1: (〈0;x〉.a|〈0;x〉.b)
   267      allFail2: (〈0;x〉.a|〈0;x〉.b)
   268    }
   269    func: {
   270      s: string
   271      ok1: (〈import;"encoding/yaml"〉.MarshalStream(〈0;s〉)|〈import;"encoding/yaml"〉.Marshal(〈0;s〉))
   272    }
   273    issue782: {
   274      a: {
   275        inner: string
   276        interpolation: (*"\(〈0;inner〉)"|string)
   277        interpolation: "override"
   278      }
   279      b: {
   280        inner: string
   281        interpolation: (string|*"\(〈0;inner〉)")
   282        interpolation: "override"
   283      }
   284      c: {
   285        inner: string
   286        interpolation: ("\(〈0;inner〉)"|string)
   287        interpolation: "override"
   288      }
   289      d: {
   290        inner: string
   291        interpolation: (string|"\(〈0;inner〉)")
   292        interpolation: "override"
   293      }
   294    }
   295  }