this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: add tests for incomplete lists comparison

Just as with scalar values, lists must be
concrete when passed to comparisson.
Add tests pre-fix.

Note that, aside from lacking functionality,
the added tests expose several bugs. These
are marked with a FIX comment.

Also note the inconsistency how CUE currently
handles incomplete values wihtin lists versus
scalars (error versus allowing it).

Issue #2583

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I2e8227ae6df7c488d505af9a8668826c7961325f
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1217005
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+1359 -57
+1337 -51
cue/testdata/basicrewrite/016_comparison.txtar
··· 1 1 #name: comparison 2 2 #evalPartial 3 3 -- in.cue -- 4 - lss: 1 < 2 5 - leq: 1 <= 1.0 6 - leq: 2.0 <= 3 7 - eql: 1 == 1.0 8 - neq: 1.0 == 1 9 - gtr: !(2 > 3) 10 - geq: 2.0 >= 2 11 - seq: "a"+"b" == "ab" 12 - err: 2 == "s" 13 - -- out/def -- 14 - lss: true 15 - leq: true 16 - eql: true 17 - neq: true 18 - gtr: true 19 - geq: true 20 - seq: true 21 - err: _|_ // invalid operation 2 == "s" (mismatched types int and string) 22 - -- out/legacy-debug -- 23 - <0>{lss: true, leq: true, eql: true, neq: true, gtr: true, geq: true, seq: true, err: _|_((2 == "s"):invalid operation 2 == "s" (mismatched types int and string))} 4 + // Explanation of error markers: 5 + // t: true 6 + // f: false 7 + // e: permanent error 8 + // i: incomplete error 9 + numbers: { 10 + tLss: 1 < 2 11 + tLeq: 1 <= 1.0 12 + tLeq: 2.0 <= 3 13 + tEql: 1 == 1.0 14 + tNeq: 1.0 == 1 15 + tGeq: 2.0 >= 2 16 + tGtr: !(2 > 3) 17 + tExpr: "a"+"b" == "ab" 18 + } 19 + -- lists.cue -- 20 + lists: { 21 + // Equal lists 22 + t1: [] == [] 23 + t2: [1, 2, 3] == [1, 2, 3] 24 + t3: [1, "foo", true] == [1, "foo", true] 25 + t4: [[1, 2], [3, 4]] == [[1, 2], [3, 4]] 26 + t5: ([1, ...int] & [1, 2, 3]) == [1, 2, 3] 27 + // FIX: 28 + t6: [1] == ([...1] & [_]) 29 + t7: [{a: 1}] == ([...{a: 1}] & [_]) 30 + t8: [{a: 1}] != [...{a: 1}] // true as it is not equal 31 + t9: [...int] == [...string] // additional types are irrelevant. 32 + 33 + // Non-equal lists 34 + f1: [1, 2, 3] == [1, 2, 4] 35 + f2: [1, 2, 3] == [1, 2] 36 + f3: [1, 2, 3] == [1, 3, 2] // different order 37 + f4: [] == [1] 38 + f5: [1, 2] == [1, "2"] // different types 39 + f6: [*1 | 2 | 3] == [*2 | 3 | 4] 40 + 41 + // Error cases 42 + // FIX: 43 + eErrPassthrough: [1/0] == [1] 44 + eIncompat: [int] == [string] // types can never match 45 + _e3l: {} 46 + eErrPassthrough: [_e3l.b] == [1] // incomplete passtrhough 47 + eErrPassthrough: [1, 2] == [1, int & string] 48 + 49 + // Inequality tests 50 + tNeq1: [1, 2] != [1, 3] 51 + fNeq2: [1, 2] != [1, 2] 52 + } 53 + -- structs.cue -- 54 + structs: eq: { 55 + // Equal structs 56 + t1: {} == {} 57 + t2: {a: 1, b: "foo"} == {a: 1, b: "foo"} 58 + t3: {a: 1, b: 2} == {b: 2, a: 1} // different order 59 + t4: {a: {x: 1, y: 2}} == {a: {x: 1, y: 2}} // nested structs 60 + t5: ({a: 1, b: 2, c: 3} & {d: 4}) == {a: 1, b: 2, c: 3, d: 4} // unification 61 + t6: {{{{a: 1}}}} == {{a: 1}} // embedding 62 + t7: {[string]: int} == {[string]: string} 63 + _t8l: *1 | 2 | 3 64 + t8: {a: _t8l} == {a: 3| *1} 65 + 66 + 67 + // Non-equal structs 68 + f1: {a: 1, b: "foo"} == {a: 2, b: "foo"} 69 + f2: {a: 1, b: "foo"} == {a: 1, c: "foo"} 70 + f3: {a: {x: 1}} == {a: {x: 2}} 71 + f4: {a: 1, b: 2} == {a: 1} 72 + f5: {} == {a: 1} 73 + f6: {a: 1} == 1 74 + f7: {a: 1, b?: 2} == {a: 1, b: 2} // optional field does not exist 75 + f8: {{{{a: 1}}}} == {{a: 1, b: 2}} // embedding 76 + _f9r: *2 | 3 | 4 77 + f9: {a: *1 | 2 | 3} == {a: _f9r} 78 + 79 + // Only test some versions of != recognizing the same code paths are 80 + // followed for ==. 81 + tNe1: {a: 1} != {a: 2} 82 + fNe1: {a: 2} != {a: 2} 83 + } 84 + ignore: { 85 + t0: {_hidden: 1} == {_hidden: 2} 86 + t1: {_hidden: 1} == {} 87 + t1: {} == {_hidden: 1} 88 + t2: {#def: 1} == {#def: 2} 89 + t3: {#def: 1} == {} 90 + t4: {} == {#def: 1} 91 + t5: {_#hiddenDef: 1} == {_#hiddenDef: 2} 92 + t6: {_#hiddenDef: 1} == {} 93 + t7: {} == {_#hiddenDef: 1} 94 + 95 + f0: {_hidden: 1} != {_hidden: 2} 96 + f1: {_hidden: 1} != {} 97 + f1: {} != {_hidden: 1} 98 + f2: {#def: 1} != {#def: 2} 99 + f3: {#def: 1} != {} 100 + f4: {} != {#def: 1} 101 + f5: {_#hiddenDef: 1} != {_#hiddenDef: 2} 102 + f6: {_#hiddenDef: 1} != {} 103 + f7: {} != {_#hiddenDef: 1} 104 + } 105 + embeddedScalars: { 106 + _one: 1 107 + _two: 2 108 + 109 + t1: 1 == {1} 110 + t2: [1] == [{1}] 111 + t3: {a: 1} == {a: {1}} 112 + t4: [_one] == [{_one}] 113 + 114 + f1: _one == [{_two}] 115 + f2: {a: _two} == {a: {_one}} 116 + f3: _one == {_two} 117 + f4: [_two] == [{_one}] 118 + } 119 + 120 + // Error cases 121 + incomplete: { 122 + _int: int 123 + _string: string 124 + 125 + iErr1: {a!: _int} == {a!: _int} 126 + iErr2: {a!: _int} == {a!: 1} 127 + eErr3: {a: _int} == {a: _string} // Can never match 128 + eErr4: {a: 1/0} == {a: 1} // Error passthrough 129 + 130 + eErr5: {a: 1} == {a: _int & _string} // Error passthrough 131 + iErr6: {a!: 1} == {a: 1} 132 + eErr7: {a: 1} == {a!: 2} // Required cannot match even when concrete. 133 + } 134 + -- typediff.cue -- 135 + diffTypes: { 136 + // Right now, all these tests are expected to report a type error. The 137 + // result indicators are assuming, however, that we define equality to be 138 + // total for all concrete values. This means that those marked as false (or 139 + // true for !=) are permanent errors. 140 + 141 + // Tests with different types. 142 + fScalar1: 2 == "s" 143 + fScalar2: "s" == 2 144 + fScalar3: true == 2 145 + 146 + fStruct1: {a: 1} == "s" 147 + 148 + fList1: 5 == [5] 149 + fList2: "ab" == ["a", "b"] 150 + fList3: true == [true] 151 + fList4: {a: 1} == [{a: 1}] 152 + fList5: [1, 2] == 3 153 + fList6: [1, 2] == "ab" 154 + fList7: [true] == false 155 + fList8: [1, 2] == {a: 1} 156 + fList9: [1, 2] == null 157 + 158 + // Negated comparisons 159 + tNeList1: [1, 2] != 3 160 + tNeList2: [1, 2] != "ab" 161 + 162 + _int: int 163 + _string: string 164 + 165 + // Lists with incompatible element types 166 + iRecursive1: [_int] == [_int] // can still match, but not concrete 167 + eRecursive2: [_int] == [_string] // can never match 168 + fRecursive3: [1, 2] == [1, "2"] 169 + tRecursive4: [...int] == [...string] 170 + fRecursive5: [1, "a"] == [1, 2] 171 + 172 + eNe1: [1, 2] != [_int] // length can never match 173 + iNe2: [_int] != [1] 174 + iNe3: {a: 1} != {a: _int} 175 + iNe4: {a: _int} != {a: 1} 176 + } 24 177 -- out/compile -- 25 178 --- in.cue 26 179 { 27 - lss: (1 < 2) 28 - leq: (1 <= 1.0) 29 - leq: (2.0 <= 3) 30 - eql: (1 == 1.0) 31 - neq: (1.0 == 1) 32 - gtr: !(2 > 3) 33 - geq: (2.0 >= 2) 34 - seq: (("a" + "b") == "ab") 35 - err: (2 == "s") 180 + numbers: { 181 + tLss: (1 < 2) 182 + tLeq: (1 <= 1.0) 183 + tLeq: (2.0 <= 3) 184 + tEql: (1 == 1.0) 185 + tNeq: (1.0 == 1) 186 + tGeq: (2.0 >= 2) 187 + tGtr: !(2 > 3) 188 + tExpr: (("a" + "b") == "ab") 189 + } 190 + } 191 + --- lists.cue 192 + { 193 + lists: { 194 + t1: ([] == []) 195 + t2: ([ 196 + 1, 197 + 2, 198 + 3, 199 + ] == [ 200 + 1, 201 + 2, 202 + 3, 203 + ]) 204 + t3: ([ 205 + 1, 206 + "foo", 207 + true, 208 + ] == [ 209 + 1, 210 + "foo", 211 + true, 212 + ]) 213 + t4: ([ 214 + [ 215 + 1, 216 + 2, 217 + ], 218 + [ 219 + 3, 220 + 4, 221 + ], 222 + ] == [ 223 + [ 224 + 1, 225 + 2, 226 + ], 227 + [ 228 + 3, 229 + 4, 230 + ], 231 + ]) 232 + t5: (([ 233 + 1, 234 + ...int, 235 + ] & [ 236 + 1, 237 + 2, 238 + 3, 239 + ]) == [ 240 + 1, 241 + 2, 242 + 3, 243 + ]) 244 + t6: ([ 245 + 1, 246 + ] == ([ 247 + ...1, 248 + ] & [ 249 + _, 250 + ])) 251 + t7: ([ 252 + { 253 + a: 1 254 + }, 255 + ] == ([ 256 + ...{ 257 + a: 1 258 + }, 259 + ] & [ 260 + _, 261 + ])) 262 + t8: ([ 263 + { 264 + a: 1 265 + }, 266 + ] != [ 267 + ...{ 268 + a: 1 269 + }, 270 + ]) 271 + t9: ([ 272 + ...int, 273 + ] == [ 274 + ...string, 275 + ]) 276 + f1: ([ 277 + 1, 278 + 2, 279 + 3, 280 + ] == [ 281 + 1, 282 + 2, 283 + 4, 284 + ]) 285 + f2: ([ 286 + 1, 287 + 2, 288 + 3, 289 + ] == [ 290 + 1, 291 + 2, 292 + ]) 293 + f3: ([ 294 + 1, 295 + 2, 296 + 3, 297 + ] == [ 298 + 1, 299 + 3, 300 + 2, 301 + ]) 302 + f4: ([] == [ 303 + 1, 304 + ]) 305 + f5: ([ 306 + 1, 307 + 2, 308 + ] == [ 309 + 1, 310 + "2", 311 + ]) 312 + f6: ([ 313 + (*1|2|3), 314 + ] == [ 315 + (*2|3|4), 316 + ]) 317 + eErrPassthrough: ([ 318 + (1 / 0), 319 + ] == [ 320 + 1, 321 + ]) 322 + eIncompat: ([ 323 + int, 324 + ] == [ 325 + string, 326 + ]) 327 + _e3l: {} 328 + eErrPassthrough: ([ 329 + 〈1;_e3l〉.b, 330 + ] == [ 331 + 1, 332 + ]) 333 + eErrPassthrough: ([ 334 + 1, 335 + 2, 336 + ] == [ 337 + 1, 338 + (int & string), 339 + ]) 340 + tNeq1: ([ 341 + 1, 342 + 2, 343 + ] != [ 344 + 1, 345 + 3, 346 + ]) 347 + fNeq2: ([ 348 + 1, 349 + 2, 350 + ] != [ 351 + 1, 352 + 2, 353 + ]) 354 + } 355 + } 356 + --- structs.cue 357 + { 358 + structs: { 359 + eq: { 360 + t1: ({} == {}) 361 + t2: ({ 362 + a: 1 363 + b: "foo" 364 + } == { 365 + a: 1 366 + b: "foo" 367 + }) 368 + t3: ({ 369 + a: 1 370 + b: 2 371 + } == { 372 + b: 2 373 + a: 1 374 + }) 375 + t4: ({ 376 + a: { 377 + x: 1 378 + y: 2 379 + } 380 + } == { 381 + a: { 382 + x: 1 383 + y: 2 384 + } 385 + }) 386 + t5: (({ 387 + a: 1 388 + b: 2 389 + c: 3 390 + } & { 391 + d: 4 392 + }) == { 393 + a: 1 394 + b: 2 395 + c: 3 396 + d: 4 397 + }) 398 + t6: ({ 399 + { 400 + { 401 + { 402 + a: 1 403 + } 404 + } 405 + } 406 + } == { 407 + { 408 + a: 1 409 + } 410 + }) 411 + t7: ({ 412 + [string]: int 413 + } == { 414 + [string]: string 415 + }) 416 + _t8l: (*1|2|3) 417 + t8: ({ 418 + a: 〈1;_t8l〉 419 + } == { 420 + a: (3|*1) 421 + }) 422 + f1: ({ 423 + a: 1 424 + b: "foo" 425 + } == { 426 + a: 2 427 + b: "foo" 428 + }) 429 + f2: ({ 430 + a: 1 431 + b: "foo" 432 + } == { 433 + a: 1 434 + c: "foo" 435 + }) 436 + f3: ({ 437 + a: { 438 + x: 1 439 + } 440 + } == { 441 + a: { 442 + x: 2 443 + } 444 + }) 445 + f4: ({ 446 + a: 1 447 + b: 2 448 + } == { 449 + a: 1 450 + }) 451 + f5: ({} == { 452 + a: 1 453 + }) 454 + f6: ({ 455 + a: 1 456 + } == 1) 457 + f7: ({ 458 + a: 1 459 + b?: 2 460 + } == { 461 + a: 1 462 + b: 2 463 + }) 464 + f8: ({ 465 + { 466 + { 467 + { 468 + a: 1 469 + } 470 + } 471 + } 472 + } == { 473 + { 474 + a: 1 475 + b: 2 476 + } 477 + }) 478 + _f9r: (*2|3|4) 479 + f9: ({ 480 + a: (*1|2|3) 481 + } == { 482 + a: 〈1;_f9r〉 483 + }) 484 + tNe1: ({ 485 + a: 1 486 + } != { 487 + a: 2 488 + }) 489 + fNe1: ({ 490 + a: 2 491 + } != { 492 + a: 2 493 + }) 494 + } 495 + } 496 + ignore: { 497 + t0: ({ 498 + _hidden: 1 499 + } == { 500 + _hidden: 2 501 + }) 502 + t1: ({ 503 + _hidden: 1 504 + } == {}) 505 + t1: ({} == { 506 + _hidden: 1 507 + }) 508 + t2: ({ 509 + #def: 1 510 + } == { 511 + #def: 2 512 + }) 513 + t3: ({ 514 + #def: 1 515 + } == {}) 516 + t4: ({} == { 517 + #def: 1 518 + }) 519 + t5: ({ 520 + _#hiddenDef: 1 521 + } == { 522 + _#hiddenDef: 2 523 + }) 524 + t6: ({ 525 + _#hiddenDef: 1 526 + } == {}) 527 + t7: ({} == { 528 + _#hiddenDef: 1 529 + }) 530 + f0: ({ 531 + _hidden: 1 532 + } != { 533 + _hidden: 2 534 + }) 535 + f1: ({ 536 + _hidden: 1 537 + } != {}) 538 + f1: ({} != { 539 + _hidden: 1 540 + }) 541 + f2: ({ 542 + #def: 1 543 + } != { 544 + #def: 2 545 + }) 546 + f3: ({ 547 + #def: 1 548 + } != {}) 549 + f4: ({} != { 550 + #def: 1 551 + }) 552 + f5: ({ 553 + _#hiddenDef: 1 554 + } != { 555 + _#hiddenDef: 2 556 + }) 557 + f6: ({ 558 + _#hiddenDef: 1 559 + } != {}) 560 + f7: ({} != { 561 + _#hiddenDef: 1 562 + }) 563 + } 564 + embeddedScalars: { 565 + _one: 1 566 + _two: 2 567 + t1: (1 == { 568 + 1 569 + }) 570 + t2: ([ 571 + 1, 572 + ] == [ 573 + { 574 + 1 575 + }, 576 + ]) 577 + t3: ({ 578 + a: 1 579 + } == { 580 + a: { 581 + 1 582 + } 583 + }) 584 + t4: ([ 585 + 〈1;_one〉, 586 + ] == [ 587 + { 588 + 〈2;_one〉 589 + }, 590 + ]) 591 + f1: (〈0;_one〉 == [ 592 + { 593 + 〈2;_two〉 594 + }, 595 + ]) 596 + f2: ({ 597 + a: 〈1;_two〉 598 + } == { 599 + a: { 600 + 〈2;_one〉 601 + } 602 + }) 603 + f3: (〈0;_one〉 == { 604 + 〈1;_two〉 605 + }) 606 + f4: ([ 607 + 〈1;_two〉, 608 + ] == [ 609 + { 610 + 〈2;_one〉 611 + }, 612 + ]) 613 + } 614 + incomplete: { 615 + _int: int 616 + _string: string 617 + iErr1: ({ 618 + a!: 〈1;_int〉 619 + } == { 620 + a!: 〈1;_int〉 621 + }) 622 + iErr2: ({ 623 + a!: 〈1;_int〉 624 + } == { 625 + a!: 1 626 + }) 627 + eErr3: ({ 628 + a: 〈1;_int〉 629 + } == { 630 + a: 〈1;_string〉 631 + }) 632 + eErr4: ({ 633 + a: (1 / 0) 634 + } == { 635 + a: 1 636 + }) 637 + eErr5: ({ 638 + a: 1 639 + } == { 640 + a: (〈1;_int〉 & 〈1;_string〉) 641 + }) 642 + iErr6: ({ 643 + a!: 1 644 + } == { 645 + a: 1 646 + }) 647 + eErr7: ({ 648 + a: 1 649 + } == { 650 + a!: 2 651 + }) 652 + } 653 + } 654 + --- typediff.cue 655 + { 656 + diffTypes: { 657 + fScalar1: (2 == "s") 658 + fScalar2: ("s" == 2) 659 + fScalar3: (true == 2) 660 + fStruct1: ({ 661 + a: 1 662 + } == "s") 663 + fList1: (5 == [ 664 + 5, 665 + ]) 666 + fList2: ("ab" == [ 667 + "a", 668 + "b", 669 + ]) 670 + fList3: (true == [ 671 + true, 672 + ]) 673 + fList4: ({ 674 + a: 1 675 + } == [ 676 + { 677 + a: 1 678 + }, 679 + ]) 680 + fList5: ([ 681 + 1, 682 + 2, 683 + ] == 3) 684 + fList6: ([ 685 + 1, 686 + 2, 687 + ] == "ab") 688 + fList7: ([ 689 + true, 690 + ] == false) 691 + fList8: ([ 692 + 1, 693 + 2, 694 + ] == { 695 + a: 1 696 + }) 697 + fList9: ([ 698 + 1, 699 + 2, 700 + ] == null) 701 + tNeList1: ([ 702 + 1, 703 + 2, 704 + ] != 3) 705 + tNeList2: ([ 706 + 1, 707 + 2, 708 + ] != "ab") 709 + _int: int 710 + _string: string 711 + iRecursive1: ([ 712 + 〈1;_int〉, 713 + ] == [ 714 + 〈1;_int〉, 715 + ]) 716 + eRecursive2: ([ 717 + 〈1;_int〉, 718 + ] == [ 719 + 〈1;_string〉, 720 + ]) 721 + fRecursive3: ([ 722 + 1, 723 + 2, 724 + ] == [ 725 + 1, 726 + "2", 727 + ]) 728 + tRecursive4: ([ 729 + ...int, 730 + ] == [ 731 + ...string, 732 + ]) 733 + fRecursive5: ([ 734 + 1, 735 + "a", 736 + ] == [ 737 + 1, 738 + 2, 739 + ]) 740 + eNe1: ([ 741 + 1, 742 + 2, 743 + ] != [ 744 + 〈1;_int〉, 745 + ]) 746 + iNe2: ([ 747 + 〈1;_int〉, 748 + ] != [ 749 + 1, 750 + ]) 751 + iNe3: ({ 752 + a: 1 753 + } != { 754 + a: 〈1;_int〉 755 + }) 756 + iNe4: ({ 757 + a: 〈1;_int〉 758 + } != { 759 + a: 1 760 + }) 761 + } 36 762 } 37 763 -- out/eval/stats -- 38 - Leaks: 0 39 - Freed: 9 40 - Reused: 7 41 - Allocs: 2 42 - Retain: 0 764 + Leaks: 112 765 + Freed: 295 766 + Reused: 292 767 + Allocs: 115 768 + Retain: 175 43 769 44 - Unifications: 9 45 - Conjuncts: 10 46 - Disjuncts: 9 770 + Unifications: 395 771 + Conjuncts: 449 772 + Disjuncts: 470 47 773 -- out/eval -- 48 774 Errors: 49 - err: invalid operands 2 and "s" to '==' (type int and string): 50 - ./in.cue:9:6 51 - ./in.cue:9:11 775 + structs.eq.t1: invalid operands {} and {} to '==' (type struct and struct): 776 + ./structs.cue:3:9 777 + ./structs.cue:3:15 778 + structs.eq.t2: invalid operands {a:1,b:"foo"} and {a:1,b:"foo"} to '==' (type struct and struct): 779 + ./structs.cue:4:9 780 + ./structs.cue:4:29 781 + structs.eq.t3: invalid operands {a:1,b:2} and {b:2,a:1} to '==' (type struct and struct): 782 + ./structs.cue:5:9 783 + ./structs.cue:5:25 784 + structs.eq.t4: invalid operands {a:{x:1,y:2}} and {a:{x:1,y:2}} to '==' (type struct and struct): 785 + ./structs.cue:6:9 786 + ./structs.cue:6:30 787 + structs.eq.t5: invalid operands {a:1,b:2,c:3,d:4} and {a:1,b:2,c:3,d:4} to '==' (type struct and struct): 788 + ./structs.cue:7:9 789 + ./structs.cue:7:10 790 + ./structs.cue:7:42 791 + structs.eq.t6: invalid operands {a:1} and {a:1} to '==' (type struct and struct): 792 + ./structs.cue:8:9 793 + ./structs.cue:8:25 794 + structs.eq.t7: invalid operands {} and {} to '==' (type struct and struct): 795 + ./structs.cue:9:9 796 + ./structs.cue:9:28 797 + structs.eq.t8: invalid operands {a:_t8l} and {a:(3|*1)} to '==' (type struct and struct): 798 + ./structs.cue:11:9 799 + ./structs.cue:11:22 800 + structs.eq.f1: invalid operands {a:1,b:"foo"} and {a:2,b:"foo"} to '==' (type struct and struct): 801 + ./structs.cue:15:9 802 + ./structs.cue:15:29 803 + structs.eq.f2: invalid operands {a:1,b:"foo"} and {a:1,c:"foo"} to '==' (type struct and struct): 804 + ./structs.cue:16:9 805 + ./structs.cue:16:29 806 + structs.eq.f3: invalid operands {a:{x:1}} and {a:{x:2}} to '==' (type struct and struct): 807 + ./structs.cue:17:9 808 + ./structs.cue:17:24 809 + structs.eq.f4: invalid operands {a:1,b:2} and {a:1} to '==' (type struct and struct): 810 + ./structs.cue:18:9 811 + ./structs.cue:18:25 812 + structs.eq.f5: invalid operands {} and {a:1} to '==' (type struct and struct): 813 + ./structs.cue:19:9 814 + ./structs.cue:19:15 815 + structs.eq.f6: invalid operands {a:1} and 1 to '==' (type struct and int): 816 + ./structs.cue:20:9 817 + ./structs.cue:20:19 818 + structs.eq.f7: invalid operands {a:1,b?:2} and {a:1,b:2} to '==' (type struct and struct): 819 + ./structs.cue:21:9 820 + ./structs.cue:21:26 821 + structs.eq.f8: invalid operands {a:1} and {a:1,b:2} to '==' (type struct and struct): 822 + ./structs.cue:22:9 823 + ./structs.cue:22:25 824 + structs.eq.f9: invalid operands {a:(*1|2|3)} and {a:_f9r} to '==' (type struct and struct): 825 + ./structs.cue:24:9 826 + ./structs.cue:24:28 827 + structs.eq.tNe1: invalid operands {a:1} and {a:2} to '!=' (type struct and struct): 828 + ./structs.cue:28:8 829 + ./structs.cue:28:18 830 + structs.eq.fNe1: invalid operands {a:2} and {a:2} to '!=' (type struct and struct): 831 + ./structs.cue:29:8 832 + ./structs.cue:29:18 833 + ignore.t0: invalid operands {_hidden:1} and {_hidden:2} to '==' (type struct and struct): 834 + ./structs.cue:32:6 835 + ./structs.cue:32:22 836 + ignore.t1: invalid operands {_hidden:1} and {} to '==' (type struct and struct): 837 + ./structs.cue:33:6 838 + ./structs.cue:33:22 839 + ignore.t1: invalid operands {} and {_hidden:1} to '==' (type struct and struct): 840 + ./structs.cue:34:6 841 + ./structs.cue:34:12 842 + ignore.t2: invalid operands {#def:1} and {#def:2} to '==' (type struct and struct): 843 + ./structs.cue:35:6 844 + ./structs.cue:35:19 845 + ignore.t3: invalid operands {#def:1} and {} to '==' (type struct and struct): 846 + ./structs.cue:36:6 847 + ./structs.cue:36:19 848 + ignore.t4: invalid operands {} and {#def:1} to '==' (type struct and struct): 849 + ./structs.cue:37:6 850 + ./structs.cue:37:12 851 + ignore.t5: invalid operands {_#hiddenDef:1} and {_#hiddenDef:2} to '==' (type struct and struct): 852 + ./structs.cue:38:6 853 + ./structs.cue:38:26 854 + ignore.t6: invalid operands {_#hiddenDef:1} and {} to '==' (type struct and struct): 855 + ./structs.cue:39:6 856 + ./structs.cue:39:26 857 + ignore.t7: invalid operands {} and {_#hiddenDef:1} to '==' (type struct and struct): 858 + ./structs.cue:40:6 859 + ./structs.cue:40:12 860 + ignore.f0: invalid operands {_hidden:1} and {_hidden:2} to '!=' (type struct and struct): 861 + ./structs.cue:42:6 862 + ./structs.cue:42:22 863 + ignore.f1: invalid operands {_hidden:1} and {} to '!=' (type struct and struct): 864 + ./structs.cue:43:6 865 + ./structs.cue:43:22 866 + ignore.f1: invalid operands {} and {_hidden:1} to '!=' (type struct and struct): 867 + ./structs.cue:44:6 868 + ./structs.cue:44:12 869 + ignore.f2: invalid operands {#def:1} and {#def:2} to '!=' (type struct and struct): 870 + ./structs.cue:45:6 871 + ./structs.cue:45:19 872 + ignore.f3: invalid operands {#def:1} and {} to '!=' (type struct and struct): 873 + ./structs.cue:46:6 874 + ./structs.cue:46:19 875 + ignore.f4: invalid operands {} and {#def:1} to '!=' (type struct and struct): 876 + ./structs.cue:47:6 877 + ./structs.cue:47:12 878 + ignore.f5: invalid operands {_#hiddenDef:1} and {_#hiddenDef:2} to '!=' (type struct and struct): 879 + ./structs.cue:48:6 880 + ./structs.cue:48:26 881 + ignore.f6: invalid operands {_#hiddenDef:1} and {} to '!=' (type struct and struct): 882 + ./structs.cue:49:6 883 + ./structs.cue:49:26 884 + ignore.f7: invalid operands {} and {_#hiddenDef:1} to '!=' (type struct and struct): 885 + ./structs.cue:50:6 886 + ./structs.cue:50:12 887 + embeddedScalars.t3: invalid operands {a:1} and {a:{1}} to '==' (type struct and struct): 888 + ./structs.cue:58:6 889 + ./structs.cue:58:16 890 + embeddedScalars.f1: invalid operands 1 and [{_two}] to '==' (type int and list): 891 + ./structs.cue:61:6 892 + ./structs.cue:53:8 893 + ./structs.cue:61:14 894 + embeddedScalars.f2: invalid operands {a:_two} and {a:{_one}} to '==' (type struct and struct): 895 + ./structs.cue:62:6 896 + ./structs.cue:62:19 897 + incomplete.iErr1: invalid operands {a!:_int} and {a!:_int} to '==' (type struct and struct): 898 + ./structs.cue:72:9 899 + ./structs.cue:72:23 900 + incomplete.iErr2: invalid operands {a!:_int} and {a!:1} to '==' (type struct and struct): 901 + ./structs.cue:73:9 902 + ./structs.cue:73:23 903 + incomplete.eErr3: invalid operands {a:_int} and {a:_string} to '==' (type struct and struct): 904 + ./structs.cue:74:9 905 + ./structs.cue:74:22 906 + incomplete.eErr4: invalid operands {a:(1 / 0)} and {a:1} to '==' (type struct and struct): 907 + ./structs.cue:75:9 908 + ./structs.cue:75:21 909 + incomplete.eErr5: invalid operands {a:1} and {a:(_int & _string)} to '==' (type struct and struct): 910 + ./structs.cue:77:9 911 + ./structs.cue:77:19 912 + incomplete.iErr6: invalid operands {a!:1} and {a:1} to '==' (type struct and struct): 913 + ./structs.cue:78:9 914 + ./structs.cue:78:20 915 + incomplete.eErr7: invalid operands {a:1} and {a!:2} to '==' (type struct and struct): 916 + ./structs.cue:79:9 917 + ./structs.cue:79:19 918 + diffTypes.fScalar1: invalid operands 2 and "s" to '==' (type int and string): 919 + ./typediff.cue:8:13 920 + ./typediff.cue:8:18 921 + diffTypes.fScalar2: cannot use 2 (type int) as type string: 922 + ./typediff.cue:9:13 923 + ./typediff.cue:9:20 924 + diffTypes.fScalar3: cannot use 2 (type int) as type bool: 925 + ./typediff.cue:10:12 926 + ./typediff.cue:10:20 927 + diffTypes.fStruct1: invalid operands {a:1} and "s" to '==' (type struct and string): 928 + ./typediff.cue:12:12 929 + ./typediff.cue:12:22 930 + diffTypes.fList1: invalid operands 5 and [5] to '==' (type int and list): 931 + ./typediff.cue:14:10 932 + ./typediff.cue:14:15 933 + diffTypes.fList2: cannot use ["a","b"] (type list) as type string: 934 + ./typediff.cue:15:10 935 + ./typediff.cue:15:18 936 + diffTypes.fList3: cannot use [true] (type list) as type bool: 937 + ./typediff.cue:16:10 938 + ./typediff.cue:16:18 939 + diffTypes.fList4: invalid operands {a:1} and [{a:1}] to '==' (type struct and list): 940 + ./typediff.cue:17:10 941 + ./typediff.cue:17:20 942 + diffTypes.fList5: invalid operands [1,2] and 3 to '==' (type list and int): 943 + ./typediff.cue:18:10 944 + ./typediff.cue:18:20 945 + diffTypes.fList6: invalid operands [1,2] and "ab" to '==' (type list and string): 946 + ./typediff.cue:19:10 947 + ./typediff.cue:19:20 948 + diffTypes.fList7: invalid operands [true] and false to '==' (type list and bool): 949 + ./typediff.cue:20:10 950 + ./typediff.cue:20:20 951 + diffTypes.fList8: invalid operands [1,2] and {a:1} to '==' (type list and struct): 952 + ./typediff.cue:21:10 953 + ./typediff.cue:21:20 954 + diffTypes.tNeList1: invalid operands [1,2] and 3 to '!=' (type list and int): 955 + ./typediff.cue:25:12 956 + ./typediff.cue:25:22 957 + diffTypes.tNeList2: invalid operands [1,2] and "ab" to '!=' (type list and string): 958 + ./typediff.cue:26:12 959 + ./typediff.cue:26:22 960 + diffTypes.iNe3: invalid operands {a:1} and {a:_int} to '!=' (type struct and struct): 961 + ./typediff.cue:40:8 962 + ./typediff.cue:40:18 963 + diffTypes.iNe4: invalid operands {a:_int} and {a:1} to '!=' (type struct and struct): 964 + ./typediff.cue:41:8 965 + ./typediff.cue:41:21 52 966 53 967 Result: 54 968 (_|_){ 55 969 // [eval] 56 - lss: (bool){ true } 57 - leq: (bool){ true } 58 - eql: (bool){ true } 59 - neq: (bool){ true } 60 - gtr: (bool){ true } 61 - geq: (bool){ true } 62 - seq: (bool){ true } 63 - err: (_|_){ 64 - // [eval] err: invalid operands 2 and "s" to '==' (type int and string): 65 - // ./in.cue:9:6 66 - // ./in.cue:9:11 970 + numbers: (struct){ 971 + tLss: (bool){ true } 972 + tLeq: (bool){ true } 973 + tEql: (bool){ true } 974 + tNeq: (bool){ true } 975 + tGeq: (bool){ true } 976 + tGtr: (bool){ true } 977 + tExpr: (bool){ true } 978 + } 979 + lists: (struct){ 980 + t1: (bool){ true } 981 + t2: (bool){ true } 982 + t3: (bool){ true } 983 + t4: (bool){ true } 984 + t5: (bool){ true } 985 + t6: (bool){ true } 986 + t7: (bool){ false } 987 + t8: (bool){ true } 988 + t9: (bool){ true } 989 + f1: (bool){ false } 990 + f2: (bool){ false } 991 + f3: (bool){ false } 992 + f4: (bool){ false } 993 + f5: (bool){ false } 994 + f6: (bool){ false } 995 + eErrPassthrough: (bool){ false } 996 + eIncompat: (bool){ false } 997 + _e3l: (struct){ 998 + } 999 + tNeq1: (bool){ true } 1000 + fNeq2: (bool){ false } 1001 + } 1002 + structs: (_|_){ 1003 + // [eval] 1004 + eq: (_|_){ 1005 + // [eval] 1006 + t1: (_|_){ 1007 + // [eval] structs.eq.t1: invalid operands {} and {} to '==' (type struct and struct): 1008 + // ./structs.cue:3:9 1009 + // ./structs.cue:3:15 1010 + } 1011 + t2: (_|_){ 1012 + // [eval] structs.eq.t2: invalid operands {a:1,b:"foo"} and {a:1,b:"foo"} to '==' (type struct and struct): 1013 + // ./structs.cue:4:9 1014 + // ./structs.cue:4:29 1015 + } 1016 + t3: (_|_){ 1017 + // [eval] structs.eq.t3: invalid operands {a:1,b:2} and {b:2,a:1} to '==' (type struct and struct): 1018 + // ./structs.cue:5:9 1019 + // ./structs.cue:5:25 1020 + } 1021 + t4: (_|_){ 1022 + // [eval] structs.eq.t4: invalid operands {a:{x:1,y:2}} and {a:{x:1,y:2}} to '==' (type struct and struct): 1023 + // ./structs.cue:6:9 1024 + // ./structs.cue:6:30 1025 + } 1026 + t5: (_|_){ 1027 + // [eval] structs.eq.t5: invalid operands {a:1,b:2,c:3,d:4} and {a:1,b:2,c:3,d:4} to '==' (type struct and struct): 1028 + // ./structs.cue:7:9 1029 + // ./structs.cue:7:10 1030 + // ./structs.cue:7:42 1031 + } 1032 + t6: (_|_){ 1033 + // [eval] structs.eq.t6: invalid operands {a:1} and {a:1} to '==' (type struct and struct): 1034 + // ./structs.cue:8:9 1035 + // ./structs.cue:8:25 1036 + } 1037 + t7: (_|_){ 1038 + // [eval] structs.eq.t7: invalid operands {} and {} to '==' (type struct and struct): 1039 + // ./structs.cue:9:9 1040 + // ./structs.cue:9:28 1041 + } 1042 + _t8l: (int){ |(*(int){ 1 }, (int){ 2 }, (int){ 3 }) } 1043 + t8: (_|_){ 1044 + // [eval] structs.eq.t8: invalid operands {a:_t8l} and {a:(3|*1)} to '==' (type struct and struct): 1045 + // ./structs.cue:11:9 1046 + // ./structs.cue:11:22 1047 + } 1048 + f1: (_|_){ 1049 + // [eval] structs.eq.f1: invalid operands {a:1,b:"foo"} and {a:2,b:"foo"} to '==' (type struct and struct): 1050 + // ./structs.cue:15:9 1051 + // ./structs.cue:15:29 1052 + } 1053 + f2: (_|_){ 1054 + // [eval] structs.eq.f2: invalid operands {a:1,b:"foo"} and {a:1,c:"foo"} to '==' (type struct and struct): 1055 + // ./structs.cue:16:9 1056 + // ./structs.cue:16:29 1057 + } 1058 + f3: (_|_){ 1059 + // [eval] structs.eq.f3: invalid operands {a:{x:1}} and {a:{x:2}} to '==' (type struct and struct): 1060 + // ./structs.cue:17:9 1061 + // ./structs.cue:17:24 1062 + } 1063 + f4: (_|_){ 1064 + // [eval] structs.eq.f4: invalid operands {a:1,b:2} and {a:1} to '==' (type struct and struct): 1065 + // ./structs.cue:18:9 1066 + // ./structs.cue:18:25 1067 + } 1068 + f5: (_|_){ 1069 + // [eval] structs.eq.f5: invalid operands {} and {a:1} to '==' (type struct and struct): 1070 + // ./structs.cue:19:9 1071 + // ./structs.cue:19:15 1072 + } 1073 + f6: (_|_){ 1074 + // [eval] structs.eq.f6: invalid operands {a:1} and 1 to '==' (type struct and int): 1075 + // ./structs.cue:20:9 1076 + // ./structs.cue:20:19 1077 + } 1078 + f7: (_|_){ 1079 + // [eval] structs.eq.f7: invalid operands {a:1,b?:2} and {a:1,b:2} to '==' (type struct and struct): 1080 + // ./structs.cue:21:9 1081 + // ./structs.cue:21:26 1082 + } 1083 + f8: (_|_){ 1084 + // [eval] structs.eq.f8: invalid operands {a:1} and {a:1,b:2} to '==' (type struct and struct): 1085 + // ./structs.cue:22:9 1086 + // ./structs.cue:22:25 1087 + } 1088 + _f9r: (int){ |(*(int){ 2 }, (int){ 3 }, (int){ 4 }) } 1089 + f9: (_|_){ 1090 + // [eval] structs.eq.f9: invalid operands {a:(*1|2|3)} and {a:_f9r} to '==' (type struct and struct): 1091 + // ./structs.cue:24:9 1092 + // ./structs.cue:24:28 1093 + } 1094 + tNe1: (_|_){ 1095 + // [eval] structs.eq.tNe1: invalid operands {a:1} and {a:2} to '!=' (type struct and struct): 1096 + // ./structs.cue:28:8 1097 + // ./structs.cue:28:18 1098 + } 1099 + fNe1: (_|_){ 1100 + // [eval] structs.eq.fNe1: invalid operands {a:2} and {a:2} to '!=' (type struct and struct): 1101 + // ./structs.cue:29:8 1102 + // ./structs.cue:29:18 1103 + } 1104 + } 1105 + } 1106 + ignore: (_|_){ 1107 + // [eval] 1108 + t0: (_|_){ 1109 + // [eval] ignore.t0: invalid operands {_hidden:1} and {_hidden:2} to '==' (type struct and struct): 1110 + // ./structs.cue:32:6 1111 + // ./structs.cue:32:22 1112 + } 1113 + t1: (_|_){ 1114 + // [eval] ignore.t1: invalid operands {_hidden:1} and {} to '==' (type struct and struct): 1115 + // ./structs.cue:33:6 1116 + // ./structs.cue:33:22 1117 + // ignore.t1: invalid operands {} and {_hidden:1} to '==' (type struct and struct): 1118 + // ./structs.cue:34:6 1119 + // ./structs.cue:34:12 1120 + } 1121 + t2: (_|_){ 1122 + // [eval] ignore.t2: invalid operands {#def:1} and {#def:2} to '==' (type struct and struct): 1123 + // ./structs.cue:35:6 1124 + // ./structs.cue:35:19 1125 + } 1126 + t3: (_|_){ 1127 + // [eval] ignore.t3: invalid operands {#def:1} and {} to '==' (type struct and struct): 1128 + // ./structs.cue:36:6 1129 + // ./structs.cue:36:19 1130 + } 1131 + t4: (_|_){ 1132 + // [eval] ignore.t4: invalid operands {} and {#def:1} to '==' (type struct and struct): 1133 + // ./structs.cue:37:6 1134 + // ./structs.cue:37:12 1135 + } 1136 + t5: (_|_){ 1137 + // [eval] ignore.t5: invalid operands {_#hiddenDef:1} and {_#hiddenDef:2} to '==' (type struct and struct): 1138 + // ./structs.cue:38:6 1139 + // ./structs.cue:38:26 1140 + } 1141 + t6: (_|_){ 1142 + // [eval] ignore.t6: invalid operands {_#hiddenDef:1} and {} to '==' (type struct and struct): 1143 + // ./structs.cue:39:6 1144 + // ./structs.cue:39:26 1145 + } 1146 + t7: (_|_){ 1147 + // [eval] ignore.t7: invalid operands {} and {_#hiddenDef:1} to '==' (type struct and struct): 1148 + // ./structs.cue:40:6 1149 + // ./structs.cue:40:12 1150 + } 1151 + f0: (_|_){ 1152 + // [eval] ignore.f0: invalid operands {_hidden:1} and {_hidden:2} to '!=' (type struct and struct): 1153 + // ./structs.cue:42:6 1154 + // ./structs.cue:42:22 1155 + } 1156 + f1: (_|_){ 1157 + // [eval] ignore.f1: invalid operands {_hidden:1} and {} to '!=' (type struct and struct): 1158 + // ./structs.cue:43:6 1159 + // ./structs.cue:43:22 1160 + // ignore.f1: invalid operands {} and {_hidden:1} to '!=' (type struct and struct): 1161 + // ./structs.cue:44:6 1162 + // ./structs.cue:44:12 1163 + } 1164 + f2: (_|_){ 1165 + // [eval] ignore.f2: invalid operands {#def:1} and {#def:2} to '!=' (type struct and struct): 1166 + // ./structs.cue:45:6 1167 + // ./structs.cue:45:19 1168 + } 1169 + f3: (_|_){ 1170 + // [eval] ignore.f3: invalid operands {#def:1} and {} to '!=' (type struct and struct): 1171 + // ./structs.cue:46:6 1172 + // ./structs.cue:46:19 1173 + } 1174 + f4: (_|_){ 1175 + // [eval] ignore.f4: invalid operands {} and {#def:1} to '!=' (type struct and struct): 1176 + // ./structs.cue:47:6 1177 + // ./structs.cue:47:12 1178 + } 1179 + f5: (_|_){ 1180 + // [eval] ignore.f5: invalid operands {_#hiddenDef:1} and {_#hiddenDef:2} to '!=' (type struct and struct): 1181 + // ./structs.cue:48:6 1182 + // ./structs.cue:48:26 1183 + } 1184 + f6: (_|_){ 1185 + // [eval] ignore.f6: invalid operands {_#hiddenDef:1} and {} to '!=' (type struct and struct): 1186 + // ./structs.cue:49:6 1187 + // ./structs.cue:49:26 1188 + } 1189 + f7: (_|_){ 1190 + // [eval] ignore.f7: invalid operands {} and {_#hiddenDef:1} to '!=' (type struct and struct): 1191 + // ./structs.cue:50:6 1192 + // ./structs.cue:50:12 1193 + } 1194 + } 1195 + embeddedScalars: (_|_){ 1196 + // [eval] 1197 + _one: (int){ 1 } 1198 + _two: (int){ 2 } 1199 + t1: (bool){ true } 1200 + t2: (bool){ true } 1201 + t3: (_|_){ 1202 + // [eval] embeddedScalars.t3: invalid operands {a:1} and {a:{1}} to '==' (type struct and struct): 1203 + // ./structs.cue:58:6 1204 + // ./structs.cue:58:16 1205 + } 1206 + t4: (bool){ true } 1207 + f1: (_|_){ 1208 + // [eval] embeddedScalars.f1: invalid operands 1 and [{_two}] to '==' (type int and list): 1209 + // ./structs.cue:61:6 1210 + // ./structs.cue:53:8 1211 + // ./structs.cue:61:14 1212 + } 1213 + f2: (_|_){ 1214 + // [eval] embeddedScalars.f2: invalid operands {a:_two} and {a:{_one}} to '==' (type struct and struct): 1215 + // ./structs.cue:62:6 1216 + // ./structs.cue:62:19 1217 + } 1218 + f3: (bool){ false } 1219 + f4: (bool){ false } 1220 + } 1221 + incomplete: (_|_){ 1222 + // [eval] 1223 + _int: (int){ int } 1224 + _string: (string){ string } 1225 + iErr1: (_|_){ 1226 + // [eval] incomplete.iErr1: invalid operands {a!:_int} and {a!:_int} to '==' (type struct and struct): 1227 + // ./structs.cue:72:9 1228 + // ./structs.cue:72:23 1229 + } 1230 + iErr2: (_|_){ 1231 + // [eval] incomplete.iErr2: invalid operands {a!:_int} and {a!:1} to '==' (type struct and struct): 1232 + // ./structs.cue:73:9 1233 + // ./structs.cue:73:23 1234 + } 1235 + eErr3: (_|_){ 1236 + // [eval] incomplete.eErr3: invalid operands {a:_int} and {a:_string} to '==' (type struct and struct): 1237 + // ./structs.cue:74:9 1238 + // ./structs.cue:74:22 1239 + } 1240 + eErr4: (_|_){ 1241 + // [eval] incomplete.eErr4: invalid operands {a:(1 / 0)} and {a:1} to '==' (type struct and struct): 1242 + // ./structs.cue:75:9 1243 + // ./structs.cue:75:21 1244 + } 1245 + eErr5: (_|_){ 1246 + // [eval] incomplete.eErr5: invalid operands {a:1} and {a:(_int & _string)} to '==' (type struct and struct): 1247 + // ./structs.cue:77:9 1248 + // ./structs.cue:77:19 1249 + } 1250 + iErr6: (_|_){ 1251 + // [eval] incomplete.iErr6: invalid operands {a!:1} and {a:1} to '==' (type struct and struct): 1252 + // ./structs.cue:78:9 1253 + // ./structs.cue:78:20 1254 + } 1255 + eErr7: (_|_){ 1256 + // [eval] incomplete.eErr7: invalid operands {a:1} and {a!:2} to '==' (type struct and struct): 1257 + // ./structs.cue:79:9 1258 + // ./structs.cue:79:19 1259 + } 1260 + } 1261 + diffTypes: (_|_){ 1262 + // [eval] 1263 + fScalar1: (_|_){ 1264 + // [eval] diffTypes.fScalar1: invalid operands 2 and "s" to '==' (type int and string): 1265 + // ./typediff.cue:8:13 1266 + // ./typediff.cue:8:18 1267 + } 1268 + fScalar2: (_|_){ 1269 + // [eval] diffTypes.fScalar2: cannot use 2 (type int) as type string: 1270 + // ./typediff.cue:9:13 1271 + // ./typediff.cue:9:20 1272 + } 1273 + fScalar3: (_|_){ 1274 + // [eval] diffTypes.fScalar3: cannot use 2 (type int) as type bool: 1275 + // ./typediff.cue:10:12 1276 + // ./typediff.cue:10:20 1277 + } 1278 + fStruct1: (_|_){ 1279 + // [eval] diffTypes.fStruct1: invalid operands {a:1} and "s" to '==' (type struct and string): 1280 + // ./typediff.cue:12:12 1281 + // ./typediff.cue:12:22 1282 + } 1283 + fList1: (_|_){ 1284 + // [eval] diffTypes.fList1: invalid operands 5 and [5] to '==' (type int and list): 1285 + // ./typediff.cue:14:10 1286 + // ./typediff.cue:14:15 1287 + } 1288 + fList2: (_|_){ 1289 + // [eval] diffTypes.fList2: cannot use ["a","b"] (type list) as type string: 1290 + // ./typediff.cue:15:10 1291 + // ./typediff.cue:15:18 1292 + } 1293 + fList3: (_|_){ 1294 + // [eval] diffTypes.fList3: cannot use [true] (type list) as type bool: 1295 + // ./typediff.cue:16:10 1296 + // ./typediff.cue:16:18 1297 + } 1298 + fList4: (_|_){ 1299 + // [eval] diffTypes.fList4: invalid operands {a:1} and [{a:1}] to '==' (type struct and list): 1300 + // ./typediff.cue:17:10 1301 + // ./typediff.cue:17:20 1302 + } 1303 + fList5: (_|_){ 1304 + // [eval] diffTypes.fList5: invalid operands [1,2] and 3 to '==' (type list and int): 1305 + // ./typediff.cue:18:10 1306 + // ./typediff.cue:18:20 1307 + } 1308 + fList6: (_|_){ 1309 + // [eval] diffTypes.fList6: invalid operands [1,2] and "ab" to '==' (type list and string): 1310 + // ./typediff.cue:19:10 1311 + // ./typediff.cue:19:20 1312 + } 1313 + fList7: (_|_){ 1314 + // [eval] diffTypes.fList7: invalid operands [true] and false to '==' (type list and bool): 1315 + // ./typediff.cue:20:10 1316 + // ./typediff.cue:20:20 1317 + } 1318 + fList8: (_|_){ 1319 + // [eval] diffTypes.fList8: invalid operands [1,2] and {a:1} to '==' (type list and struct): 1320 + // ./typediff.cue:21:10 1321 + // ./typediff.cue:21:20 1322 + } 1323 + fList9: (bool){ false } 1324 + tNeList1: (_|_){ 1325 + // [eval] diffTypes.tNeList1: invalid operands [1,2] and 3 to '!=' (type list and int): 1326 + // ./typediff.cue:25:12 1327 + // ./typediff.cue:25:22 1328 + } 1329 + tNeList2: (_|_){ 1330 + // [eval] diffTypes.tNeList2: invalid operands [1,2] and "ab" to '!=' (type list and string): 1331 + // ./typediff.cue:26:12 1332 + // ./typediff.cue:26:22 1333 + } 1334 + _int: (int){ int } 1335 + _string: (string){ string } 1336 + iRecursive1: (bool){ false } 1337 + eRecursive2: (bool){ false } 1338 + fRecursive3: (bool){ false } 1339 + tRecursive4: (bool){ true } 1340 + fRecursive5: (bool){ false } 1341 + eNe1: (bool){ true } 1342 + iNe2: (bool){ true } 1343 + iNe3: (_|_){ 1344 + // [eval] diffTypes.iNe3: invalid operands {a:1} and {a:_int} to '!=' (type struct and struct): 1345 + // ./typediff.cue:40:8 1346 + // ./typediff.cue:40:18 1347 + } 1348 + iNe4: (_|_){ 1349 + // [eval] diffTypes.iNe4: invalid operands {a:_int} and {a:1} to '!=' (type struct and struct): 1350 + // ./typediff.cue:41:8 1351 + // ./typediff.cue:41:21 1352 + } 67 1353 } 68 1354 }
+22 -6
cue/testdata/lists/021_list_equality.txtar
··· 60 60 fne9: [1, ...] != [1, 2] 61 61 fne10: [1, 2] != [1, ...] 62 62 fne11: [1, ...] != [1, 2, ...] 63 + 64 + eqIncomplete1: [1] == [string] 65 + 66 + neIncomplete1: [1] != [string] 63 67 -- out/def -- 64 68 eq0: true 65 69 eq1: true ··· 479 483 2, 480 484 ..., 481 485 ]) 486 + eqIncomplete1: ([ 487 + 1, 488 + ] == [ 489 + string, 490 + ]) 491 + neIncomplete1: ([ 492 + 1, 493 + ] != [ 494 + string, 495 + ]) 482 496 } 483 497 -- out/eval/stats -- 484 498 Leaks: 0 485 - Freed: 234 486 - Reused: 229 499 + Freed: 244 500 + Reused: 239 487 501 Allocs: 5 488 - Retain: 96 502 + Retain: 100 489 503 490 - Unifications: 234 491 - Conjuncts: 234 492 - Disjuncts: 330 504 + Unifications: 244 505 + Conjuncts: 244 506 + Disjuncts: 344 493 507 -- out/eval -- 494 508 (struct){ 495 509 eq0: (bool){ true } ··· 540 554 fne9: (bool){ true } 541 555 fne10: (bool){ true } 542 556 fne11: (bool){ true } 557 + eqIncomplete1: (bool){ false } 558 + neIncomplete1: (bool){ true } 543 559 }