...

Text file src/cuelang.org/go/cue/testdata/resolve/045_range_unification.txtar

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

     1# DO NOT EDIT; generated by go run testdata/gen.go
     2#
     3#name: range unification
     4#evalPartial
     5-- in.cue --
     6	// with concrete values
     7a1: >=1 & <=5 & 3
     8a2: >=1 & <=5 & 1
     9a3: >=1 & <=5 & 5
    10a4: >=1 & <=5 & 6
    11a5: >=1 & <=5 & 0
    12
    13a6:  3 & >=1 & <=5
    14a7:  1 & >=1 & <=5
    15a8:  5 & >=1 & <=5
    16a9:  6 & >=1 & <=5
    17a10: 0 & >=1 & <=5
    18
    19// with ranges
    20b1: >=1 & <=5 & >=1 & <=5
    21b2: >=1 & <=5 & >=1 & <=1
    22b3: >=1 & <=5 & >=5 & <=5
    23b4: >=1 & <=5 & >=2 & <=3
    24b5: >=1 & <=5 & >=3 & <=9
    25b6: >=1 & <=5 & >=5 & <=9
    26b7: >=1 & <=5 & >=6 & <=9
    27
    28b8:  >=1 & <=5 & >=1 & <=5
    29b9:  >=1 & <=1 & >=1 & <=5
    30b10: >=5 & <=5 & >=1 & <=5
    31b11: >=2 & <=3 & >=1 & <=5
    32b12: >=3 & <=9 & >=1 & <=5
    33b13: >=5 & <=9 & >=1 & <=5
    34b14: >=6 & <=9 & >=1 & <=5
    35
    36// ranges with more general types
    37c1: int & >=1 & <=5
    38c2: >=1 & <=5 & int
    39c3: string & >=1 & <=5
    40c4: >=1 & <=5 & string
    41
    42// other types
    43s1: >="d" & <="z" & "e"
    44s2: >="d" & <="z" & "ee"
    45
    46n1: number & >=1 & <=2
    47n2: int & >=1.1 & <=1.3
    48n3: >=1.0 & <=3.0 & 2
    49n4: >=0.0 & <=0.1 & 0.09999
    50n5: >=1 & <=5 & 2.5
    51-- out/def --
    52	// with concrete values
    53a1:  3
    54a2:  1
    55a3:  5
    56a4:  _|_ // invalid value 6 (out of bound <=5)
    57a5:  _|_ // invalid value 0 (out of bound >=1)
    58a6:  3
    59a7:  1
    60a8:  5
    61a9:  _|_ // invalid value 6 (out of bound <=5)
    62a10: _|_ // invalid value 0 (out of bound >=1)
    63
    64// with ranges
    65b1:  >=1 & <=5
    66b2:  1
    67b3:  5
    68b4:  >=2 & <=3
    69b5:  >=3 & <=5
    70b6:  5
    71b7:  _|_ // conflicting bounds >=6 and <=5
    72b8:  >=1 & <=5
    73b9:  1
    74b10: 5
    75b11: >=2 & <=3
    76b12: >=3 & <=5
    77b13: 5
    78b14: _|_ // conflicting bounds >=6 and <=5
    79
    80// ranges with more general types
    81c1: uint & >=1 & <=5
    82c2: uint & >=1 & <=5
    83c3: _|_ // conflicting values string and >=1 (mismatched types string and number)
    84c4: _|_ // conflicting values (>=1 & <=5) and string (mismatched types number and string)
    85
    86// other types
    87s1: "e"
    88s2: "ee"
    89n1: >=1 & <=2
    90n2: _|_ // conflicting bounds int & >=1.1 and <=1.3
    91n3: 2
    92n4: 0.09999
    93n5: 2.5
    94-- out/legacy-debug --
    95<0>{a1: 3, a2: 1, a3: 5, a4: _|_((<=5 & 6):invalid value 6 (out of bound <=5)), a5: _|_((>=1 & 0):invalid value 0 (out of bound >=1)), a6: 3, a7: 1, a8: 5, a9: _|_((<=5 & 6):invalid value 6 (out of bound <=5)), a10: _|_((>=1 & 0):invalid value 0 (out of bound >=1)), b1: (>=1 & <=5), b2: 1, b3: 5, b4: (>=2 & <=3), b5: (>=3 & <=5), b6: 5, b7: _|_(conflicting bounds >=6 and <=5), b8: (>=1 & <=5), b9: 1, b10: 5, b11: (>=2 & <=3), b12: (>=3 & <=5), b13: 5, b14: _|_(conflicting bounds >=6 and <=5), c1: (int & >=1 & <=5), c2: (<=5 & int & >=1), c3: _|_((string & >=1):conflicting values string and >=1 (mismatched types string and number)), c4: _|_(((>=1 & <=5) & string):conflicting values (>=1 & <=5) and string (mismatched types number and string)), s1: "e", s2: "ee", n1: (>=1 & <=2), n2: _|_(conflicting bounds int & >=1.1 and <=1.3), n3: 2, n4: 0.09999, n5: 2.5}
    96-- out/compile --
    97--- in.cue
    98{
    99  a1: ((>=1 & <=5) & 3)
   100  a2: ((>=1 & <=5) & 1)
   101  a3: ((>=1 & <=5) & 5)
   102  a4: ((>=1 & <=5) & 6)
   103  a5: ((>=1 & <=5) & 0)
   104  a6: ((3 & >=1) & <=5)
   105  a7: ((1 & >=1) & <=5)
   106  a8: ((5 & >=1) & <=5)
   107  a9: ((6 & >=1) & <=5)
   108  a10: ((0 & >=1) & <=5)
   109  b1: (((>=1 & <=5) & >=1) & <=5)
   110  b2: (((>=1 & <=5) & >=1) & <=1)
   111  b3: (((>=1 & <=5) & >=5) & <=5)
   112  b4: (((>=1 & <=5) & >=2) & <=3)
   113  b5: (((>=1 & <=5) & >=3) & <=9)
   114  b6: (((>=1 & <=5) & >=5) & <=9)
   115  b7: (((>=1 & <=5) & >=6) & <=9)
   116  b8: (((>=1 & <=5) & >=1) & <=5)
   117  b9: (((>=1 & <=1) & >=1) & <=5)
   118  b10: (((>=5 & <=5) & >=1) & <=5)
   119  b11: (((>=2 & <=3) & >=1) & <=5)
   120  b12: (((>=3 & <=9) & >=1) & <=5)
   121  b13: (((>=5 & <=9) & >=1) & <=5)
   122  b14: (((>=6 & <=9) & >=1) & <=5)
   123  c1: ((int & >=1) & <=5)
   124  c2: ((>=1 & <=5) & int)
   125  c3: ((string & >=1) & <=5)
   126  c4: ((>=1 & <=5) & string)
   127  s1: ((>="d" & <="z") & "e")
   128  s2: ((>="d" & <="z") & "ee")
   129  n1: ((number & >=1) & <=2)
   130  n2: ((int & >=1.1) & <=1.3)
   131  n3: ((>=1.0 & <=3.0) & 2)
   132  n4: ((>=0.0 & <=0.1) & 0.09999)
   133  n5: ((>=1 & <=5) & 2.5)
   134}
   135-- out/eval/stats --
   136Leaks:  0
   137Freed:  36
   138Reused: 34
   139Allocs: 2
   140Retain: 0
   141
   142Unifications: 36
   143Conjuncts:    120
   144Disjuncts:    36
   145-- out/evalalpha --
   146Errors:
   147c3: conflicting values string and >=1 (mismatched types string and number):
   148    ./in.cue:34:5
   149    ./in.cue:34:14
   150c4: conflicting values string and >=1 (mismatched types string and number):
   151    ./in.cue:35:5
   152    ./in.cue:35:17
   153a4: invalid value 6 (out of bound <=5):
   154    ./in.cue:5:11
   155    ./in.cue:5:17
   156a5: invalid value 0 (out of bound >=1):
   157    ./in.cue:6:5
   158    ./in.cue:6:17
   159a9: invalid value 6 (out of bound <=5):
   160    ./in.cue:11:16
   161    ./in.cue:11:6
   162a10: invalid value 0 (out of bound >=1):
   163    ./in.cue:12:10
   164    ./in.cue:12:6
   165b7: incompatible bounds >=6 and <=5:
   166    ./in.cue:21:17
   167    ./in.cue:21:11
   168b14: incompatible bounds >=6 and <=5:
   169    ./in.cue:29:24
   170    ./in.cue:29:6
   171n2: incompatible bounds >=1.1 and <=1.3:
   172    ./in.cue:42:19
   173    ./in.cue:42:11
   174
   175Result:
   176(_|_){
   177  // [eval]
   178  a1: (int){ 3 }
   179  a2: (int){ 1 }
   180  a3: (int){ 5 }
   181  a4: (_|_){
   182    // [eval] a4: invalid value 6 (out of bound <=5):
   183    //     ./in.cue:5:11
   184    //     ./in.cue:5:17
   185  }
   186  a5: (_|_){
   187    // [eval] a5: invalid value 0 (out of bound >=1):
   188    //     ./in.cue:6:5
   189    //     ./in.cue:6:17
   190  }
   191  a6: (int){ 3 }
   192  a7: (int){ 1 }
   193  a8: (int){ 5 }
   194  a9: (_|_){
   195    // [eval] a9: invalid value 6 (out of bound <=5):
   196    //     ./in.cue:11:16
   197    //     ./in.cue:11:6
   198  }
   199  a10: (_|_){
   200    // [eval] a10: invalid value 0 (out of bound >=1):
   201    //     ./in.cue:12:10
   202    //     ./in.cue:12:6
   203  }
   204  b1: (number){ &(>=1, <=5) }
   205  b2: (number){ 1 }
   206  b3: (number){ 5 }
   207  b4: (number){ &(>=2, <=3) }
   208  b5: (number){ &(>=3, <=5) }
   209  b6: (number){ 5 }
   210  b7: (_|_){
   211    // [eval] b7: incompatible bounds >=6 and <=5:
   212    //     ./in.cue:21:17
   213    //     ./in.cue:21:11
   214  }
   215  b8: (number){ &(>=1, <=5) }
   216  b9: (number){ 1 }
   217  b10: (number){ 5 }
   218  b11: (number){ &(>=2, <=3) }
   219  b12: (number){ &(>=3, <=5) }
   220  b13: (number){ 5 }
   221  b14: (_|_){
   222    // [eval] b14: incompatible bounds >=6 and <=5:
   223    //     ./in.cue:29:24
   224    //     ./in.cue:29:6
   225  }
   226  c1: (int){ &(>=1, <=5, int) }
   227  c2: (int){ &(>=1, <=5, int) }
   228  c3: (_|_){
   229    // [eval] c3: conflicting values string and >=1 (mismatched types string and number):
   230    //     ./in.cue:34:5
   231    //     ./in.cue:34:14
   232  }
   233  c4: (_|_){
   234    // [eval] c4: conflicting values string and >=1 (mismatched types string and number):
   235    //     ./in.cue:35:5
   236    //     ./in.cue:35:17
   237  }
   238  s1: (string){ "e" }
   239  s2: (string){ "ee" }
   240  n1: (number){ &(>=1, <=2) }
   241  n2: (_|_){
   242    // [eval] n2: incompatible bounds >=1.1 and <=1.3:
   243    //     ./in.cue:42:19
   244    //     ./in.cue:42:11
   245  }
   246  n3: (int){ 2 }
   247  n4: (float){ 0.09999 }
   248  n5: (float){ 2.5 }
   249}
   250-- diff/-out/evalalpha<==>+out/eval --
   251diff old new
   252--- old
   253+++ new
   254@@ -1,19 +1,10 @@
   255 Errors:
   256-b14: incompatible bounds >=6 and <=5:
   257-    ./in.cue:29:6
   258-    ./in.cue:29:24
   259-b7: incompatible bounds >=6 and <=5:
   260-    ./in.cue:21:11
   261-    ./in.cue:21:17
   262 c3: conflicting values string and >=1 (mismatched types string and number):
   263     ./in.cue:34:5
   264     ./in.cue:34:14
   265-c4: conflicting values >=1 and string (mismatched types number and string):
   266+c4: conflicting values string and >=1 (mismatched types string and number):
   267     ./in.cue:35:5
   268     ./in.cue:35:17
   269-n2: incompatible bounds >=1.1 and <=1.3:
   270-    ./in.cue:42:11
   271-    ./in.cue:42:19
   272 a4: invalid value 6 (out of bound <=5):
   273     ./in.cue:5:11
   274     ./in.cue:5:17
   275@@ -26,6 +17,15 @@
   276 a10: invalid value 0 (out of bound >=1):
   277     ./in.cue:12:10
   278     ./in.cue:12:6
   279+b7: incompatible bounds >=6 and <=5:
   280+    ./in.cue:21:17
   281+    ./in.cue:21:11
   282+b14: incompatible bounds >=6 and <=5:
   283+    ./in.cue:29:24
   284+    ./in.cue:29:6
   285+n2: incompatible bounds >=1.1 and <=1.3:
   286+    ./in.cue:42:19
   287+    ./in.cue:42:11
   288 
   289 Result:
   290 (_|_){
   291@@ -64,8 +64,8 @@
   292   b6: (number){ 5 }
   293   b7: (_|_){
   294     // [eval] b7: incompatible bounds >=6 and <=5:
   295-    //     ./in.cue:21:11
   296     //     ./in.cue:21:17
   297+    //     ./in.cue:21:11
   298   }
   299   b8: (number){ &(>=1, <=5) }
   300   b9: (number){ 1 }
   301@@ -75,8 +75,8 @@
   302   b13: (number){ 5 }
   303   b14: (_|_){
   304     // [eval] b14: incompatible bounds >=6 and <=5:
   305-    //     ./in.cue:29:6
   306     //     ./in.cue:29:24
   307+    //     ./in.cue:29:6
   308   }
   309   c1: (int){ &(>=1, <=5, int) }
   310   c2: (int){ &(>=1, <=5, int) }
   311@@ -86,7 +86,7 @@
   312     //     ./in.cue:34:14
   313   }
   314   c4: (_|_){
   315-    // [eval] c4: conflicting values >=1 and string (mismatched types number and string):
   316+    // [eval] c4: conflicting values string and >=1 (mismatched types string and number):
   317     //     ./in.cue:35:5
   318     //     ./in.cue:35:17
   319   }
   320@@ -95,8 +95,8 @@
   321   n1: (number){ &(>=1, <=2) }
   322   n2: (_|_){
   323     // [eval] n2: incompatible bounds >=1.1 and <=1.3:
   324-    //     ./in.cue:42:11
   325     //     ./in.cue:42:19
   326+    //     ./in.cue:42:11
   327   }
   328   n3: (int){ 2 }
   329   n4: (float){ 0.09999 }
   330-- diff/todo/p3 --
   331Reordering of error messages.
   332-- out/eval --
   333Errors:
   334b14: incompatible bounds >=6 and <=5:
   335    ./in.cue:29:6
   336    ./in.cue:29:24
   337b7: incompatible bounds >=6 and <=5:
   338    ./in.cue:21:11
   339    ./in.cue:21:17
   340c3: conflicting values string and >=1 (mismatched types string and number):
   341    ./in.cue:34:5
   342    ./in.cue:34:14
   343c4: conflicting values >=1 and string (mismatched types number and string):
   344    ./in.cue:35:5
   345    ./in.cue:35:17
   346n2: incompatible bounds >=1.1 and <=1.3:
   347    ./in.cue:42:11
   348    ./in.cue:42:19
   349a4: invalid value 6 (out of bound <=5):
   350    ./in.cue:5:11
   351    ./in.cue:5:17
   352a5: invalid value 0 (out of bound >=1):
   353    ./in.cue:6:5
   354    ./in.cue:6:17
   355a9: invalid value 6 (out of bound <=5):
   356    ./in.cue:11:16
   357    ./in.cue:11:6
   358a10: invalid value 0 (out of bound >=1):
   359    ./in.cue:12:10
   360    ./in.cue:12:6
   361
   362Result:
   363(_|_){
   364  // [eval]
   365  a1: (int){ 3 }
   366  a2: (int){ 1 }
   367  a3: (int){ 5 }
   368  a4: (_|_){
   369    // [eval] a4: invalid value 6 (out of bound <=5):
   370    //     ./in.cue:5:11
   371    //     ./in.cue:5:17
   372  }
   373  a5: (_|_){
   374    // [eval] a5: invalid value 0 (out of bound >=1):
   375    //     ./in.cue:6:5
   376    //     ./in.cue:6:17
   377  }
   378  a6: (int){ 3 }
   379  a7: (int){ 1 }
   380  a8: (int){ 5 }
   381  a9: (_|_){
   382    // [eval] a9: invalid value 6 (out of bound <=5):
   383    //     ./in.cue:11:16
   384    //     ./in.cue:11:6
   385  }
   386  a10: (_|_){
   387    // [eval] a10: invalid value 0 (out of bound >=1):
   388    //     ./in.cue:12:10
   389    //     ./in.cue:12:6
   390  }
   391  b1: (number){ &(>=1, <=5) }
   392  b2: (number){ 1 }
   393  b3: (number){ 5 }
   394  b4: (number){ &(>=2, <=3) }
   395  b5: (number){ &(>=3, <=5) }
   396  b6: (number){ 5 }
   397  b7: (_|_){
   398    // [eval] b7: incompatible bounds >=6 and <=5:
   399    //     ./in.cue:21:11
   400    //     ./in.cue:21:17
   401  }
   402  b8: (number){ &(>=1, <=5) }
   403  b9: (number){ 1 }
   404  b10: (number){ 5 }
   405  b11: (number){ &(>=2, <=3) }
   406  b12: (number){ &(>=3, <=5) }
   407  b13: (number){ 5 }
   408  b14: (_|_){
   409    // [eval] b14: incompatible bounds >=6 and <=5:
   410    //     ./in.cue:29:6
   411    //     ./in.cue:29:24
   412  }
   413  c1: (int){ &(>=1, <=5, int) }
   414  c2: (int){ &(>=1, <=5, int) }
   415  c3: (_|_){
   416    // [eval] c3: conflicting values string and >=1 (mismatched types string and number):
   417    //     ./in.cue:34:5
   418    //     ./in.cue:34:14
   419  }
   420  c4: (_|_){
   421    // [eval] c4: conflicting values >=1 and string (mismatched types number and string):
   422    //     ./in.cue:35:5
   423    //     ./in.cue:35:17
   424  }
   425  s1: (string){ "e" }
   426  s2: (string){ "ee" }
   427  n1: (number){ &(>=1, <=2) }
   428  n2: (_|_){
   429    // [eval] n2: incompatible bounds >=1.1 and <=1.3:
   430    //     ./in.cue:42:11
   431    //     ./in.cue:42:19
   432  }
   433  n3: (int){ 2 }
   434  n4: (float){ 0.09999 }
   435  n5: (float){ 2.5 }
   436}

View as plain text