this repo has no description
0
fork

Configure Feed

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

all: prevent duplicate filenames in testscripts

This updates the setup Params for testscript, repo-wide, with the
setting RequireUniqueNames. This enforces unique filenames inside txtar
archives, rather than silently using the final version of any duplicate
files.

Some txtar archives are updated to meet this requirement.

Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
Change-Id: I379fda26134374b887115d39ec88d5fead4f0fdb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193758
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

authored by

Jonathan Matthews and committed by
Daniel Martí
a835fb51 797d6f4b

+4 -459
+1
cmd/cue/cmd/script_test.go
··· 101 101 Dir: filepath.Join("testdata", "script"), 102 102 UpdateScripts: cuetest.UpdateGoldenFiles, 103 103 RequireExplicitExec: true, 104 + RequireUniqueNames: true, 104 105 Cmds: map[string]func(ts *testscript.TestScript, neg bool, args []string){ 105 106 // env-fill rewrites its argument files to replace any environment variable 106 107 // references with their values, using the same algorithm as cmpenv.
-14
cmd/cue/cmd/testdata/script/def_openapi.txtar
··· 240 240 b: uint & <10 241 241 ... 242 242 } 243 - -- expect-cue2 -- 244 - info: { 245 - title: *"Some clever title." | string 246 - version: *"v1" | string 247 - } 248 - #Bar: { 249 - foo: #Foo 250 - ... 251 - } 252 - #Foo: { 253 - a: int 254 - b: uint & <10 255 - ... 256 - } 257 243 -- expect-cue3 -- 258 244 // My OpenAPI 259 245
-4
cmd/cue/cmd/testdata/script/import_proto.txtar
··· 14 14 Use -Rf to override. 15 15 -- root/cue.mod/module.cue -- 16 16 module: "acme.test/api" 17 - 18 - -- root/cue.mod/module.cue -- 19 - module: "acme.test/api" 20 - 21 17 -- root/cue.mod/gen/googleapis.com/acme/test/test/test_proto_gen.cue -- 22 18 package test_test 23 19
-4
cmd/cue/cmd/testdata/script/import_proto2.txtar
··· 14 14 Use -Rf to override. 15 15 -- root/cue.mod/module.cue -- 16 16 module: "acme.test/api" 17 - 18 - -- root/cue.mod/module.cue -- 19 - module: "acme.test/api" 20 - 21 17 -- root/cue.mod/gen/googleapis.com/acme/test/test/test_proto_gen.cue -- 22 18 package test_test 23 19
-8
cmd/cue/cmd/testdata/script/modinit_withsource.txtar
··· 25 25 source: { 26 26 kind: "self" 27 27 } 28 - -- want-module.cue-0 -- 29 - module: "test.example" 30 - language: { 31 - version: "v0.9.0-alpha.2" 32 - } 33 - source: { 34 - kind: "self" 35 - } 36 28 -- want-module.cue-1 -- 37 29 module: "test.example" 38 30 language: {
-6
cmd/cue/cmd/testdata/script/vet_embed.txtar
··· 42 42 ./schema.cue:3:7 43 43 ./schema.cue:7:1 44 44 ./stream.yaml:2:1 45 - -- expect-stream -- 46 - d: field not allowed: 47 - ./schema.cue:1:1 48 - ./schema.cue:3:7 49 - ./schema.cue:7:1 50 - ./stream.yaml:2:1
+1
cue/interpreter/wasm/exe_test.go
··· 47 47 Dir: "testdata/cue", 48 48 UpdateScripts: cuetest.UpdateGoldenFiles, 49 49 RequireExplicitExec: true, 50 + RequireUniqueNames: true, 50 51 Setup: func(e *testscript.Env) error { 51 52 copyWasmFiles(t, e.WorkDir, wasmFiles) 52 53 return nil
+1 -398
cue/testdata/cycle/issue990.txtar
··· 310 310 })]]]]] 311 311 } 312 312 } 313 - -- diff/-out/evalalpha<==>+out/eval -- 314 - diff old new 315 - --- old 316 - +++ new 317 - @@ -1,4 +1,10 @@ 318 - -(struct){ 319 - +Errors: 320 - +out.subs.subs.#p: structural cycle: 321 - + ./in.cue:32:16 322 - + 323 - +Result: 324 - +(_|_){ 325 - + // [structural cycle] 326 - #AC: (#struct){ 327 - k: (string){ "simple" } 328 - d: (#struct){ 329 - @@ -14,19 +20,12 @@ 330 - } 331 - } 332 - #R: (#struct){ 333 - - a: (#struct){ |((#struct){ 334 - - k: (string){ "simple" } 335 - - d: (#struct){ 336 - - n: (string){ string } 337 - - } 338 - - }, (#struct){ 339 - - k: (string){ "complex" } 340 - - d: (#struct){ 341 - - n: (string){ string } 342 - - r: (#struct){ 343 - - } 344 - - } 345 - - }) } 346 - + a: (#struct){ 347 - + k: (string){ "simple" } 348 - + d: (#struct){ 349 - + n: (string){ string } 350 - + } 351 - + } 352 - } 353 - #S: (#struct){ 354 - n: (string){ string } 355 - @@ -47,201 +46,187 @@ 356 - } 357 - dict: (#struct){ 358 - } 359 - - let subs#1multi = (〈3;#sub〉 & { 360 - - #p: 〈2;rd〉.a 361 - - }) 362 - + let subs#1multi = &[&[&[&[(〈3;#sub〉 & { 363 - + #p: 〈2;rd〉.a 364 - + })]]]] 365 - } 366 - _test: (struct){ 367 - c1: (#struct){ 368 - - k: (string){ "simple" } 369 - d: (#struct){ 370 - n: (string){ "c1" } 371 - } 372 - + k: (string){ "simple" } 373 - } 374 - s3: (#struct){ 375 - - k: (string){ "complex" } 376 - d: (#struct){ 377 - n: (string){ "s3" } 378 - r: (#struct){ 379 - r1: (#struct){ 380 - a: (#struct){ 381 - - k: (string){ "simple" } 382 - - d: (#struct){ 383 - - n: (string){ "c1" } 384 - - } 385 - - } 386 - - } 387 - - } 388 - - } 389 - + d: (#struct){ 390 - + n: (string){ "c1" } 391 - + } 392 - + k: (string){ "simple" } 393 - + } 394 - + } 395 - + } 396 - + } 397 - + k: (string){ "complex" } 398 - } 399 - s2: (#struct){ 400 - - k: (string){ "complex" } 401 - d: (#struct){ 402 - n: (string){ "s2" } 403 - r: (#struct){ 404 - r1: (#struct){ 405 - a: (#struct){ 406 - - k: (string){ "simple" } 407 - - d: (#struct){ 408 - - n: (string){ "c1" } 409 - - } 410 - - } 411 - - } 412 - - r2: (#struct){ 413 - - a: (#struct){ 414 - - k: (string){ "complex" } 415 - + d: (#struct){ 416 - + n: (string){ "c1" } 417 - + } 418 - + k: (string){ "simple" } 419 - + } 420 - + } 421 - + r2: (#struct){ 422 - + a: (#struct){ 423 - d: (#struct){ 424 - n: (string){ "s3" } 425 - r: (#struct){ 426 - r1: (#struct){ 427 - a: (#struct){ 428 - - k: (string){ "simple" } 429 - - d: (#struct){ 430 - - n: (string){ "c1" } 431 - - } 432 - - } 433 - - } 434 - - } 435 - - } 436 - - } 437 - - } 438 - - } 439 - - } 440 - + d: (#struct){ 441 - + n: (string){ "c1" } 442 - + } 443 - + k: (string){ "simple" } 444 - + } 445 - + } 446 - + } 447 - + } 448 - + k: (string){ "complex" } 449 - + } 450 - + } 451 - + } 452 - + } 453 - + k: (string){ "complex" } 454 - } 455 - s1: (#struct){ 456 - - k: (string){ "complex" } 457 - - d: (#struct){ 458 - - n: (string){ "s1" } 459 - - r: (#struct){ 460 - - r1: (#struct){ 461 - - a: (#struct){ 462 - - k: (string){ "simple" } 463 - - d: (#struct){ 464 - - n: (string){ "c1" } 465 - - } 466 - - } 467 - - } 468 - - r2: (#struct){ 469 - - a: (#struct){ 470 - - k: (string){ "complex" } 471 - - d: (#struct){ 472 - - n: (string){ "s2" } 473 - - r: (#struct){ 474 - - r1: (#struct){ 475 - - a: (#struct){ 476 - - k: (string){ "simple" } 477 - - d: (#struct){ 478 - - n: (string){ "c1" } 479 - - } 480 - - } 481 - - } 482 - - r2: (#struct){ 483 - - a: (#struct){ 484 - - k: (string){ "complex" } 485 - - d: (#struct){ 486 - - n: (string){ "s3" } 487 - - r: (#struct){ 488 - - r1: (#struct){ 489 - - a: (#struct){ 490 - - k: (string){ "simple" } 491 - - d: (#struct){ 492 - - n: (string){ "c1" } 493 - - } 494 - - } 495 - - } 496 - - } 497 - - } 498 - - } 499 - - } 500 - - } 501 - - } 502 - - } 503 - - } 504 - - } 505 - - } 506 - - } 507 - - } 508 - - out: (#struct){ 509 - - #p: (#struct){ 510 - - k: (string){ "complex" } 511 - - d: (#struct){ 512 - - n: (string){ "s1" } 513 - - r: (#struct){ 514 - - r1: (#struct){ 515 - - a: (#struct){ 516 - - k: (string){ "simple" } 517 - - d: (#struct){ 518 - - n: (string){ "c1" } 519 - - } 520 - - } 521 - - } 522 - - r2: (#struct){ 523 - - a: (#struct){ 524 - - k: (string){ "complex" } 525 - - d: (#struct){ 526 - - n: (string){ "s2" } 527 - - r: (#struct){ 528 - - r1: (#struct){ 529 - - a: (#struct){ 530 - - k: (string){ "simple" } 531 - - d: (#struct){ 532 - - n: (string){ "c1" } 533 - - } 534 - - } 535 - - } 536 - - r2: (#struct){ 537 - - a: (#struct){ 538 - - k: (string){ "complex" } 539 - - d: (#struct){ 540 - - n: (string){ "s3" } 541 - - r: (#struct){ 542 - - r1: (#struct){ 543 - - a: (#struct){ 544 - - k: (string){ "simple" } 545 - - d: (#struct){ 546 - - n: (string){ "c1" } 547 - - } 548 - - } 549 - - } 550 - - } 551 - - } 552 - - } 553 - - } 554 - - } 555 - - } 556 - - } 557 - - } 558 - - } 559 - - } 560 - + d: (#struct){ 561 - + n: (string){ "s1" } 562 - + r: (#struct){ 563 - + r1: (#struct){ 564 - + a: (#struct){ 565 - + d: (#struct){ 566 - + n: (string){ "c1" } 567 - + } 568 - + k: (string){ "simple" } 569 - + } 570 - + } 571 - + r2: (#struct){ 572 - + a: (#struct){ 573 - + d: (#struct){ 574 - + n: (string){ "s2" } 575 - + r: (#struct){ 576 - + r1: (#struct){ 577 - + a: (#struct){ 578 - + d: (#struct){ 579 - + n: (string){ "c1" } 580 - + } 581 - + k: (string){ "simple" } 582 - + } 583 - + } 584 - + r2: (#struct){ 585 - + a: (#struct){ 586 - + d: (#struct){ 587 - + n: (string){ "s3" } 588 - + r: (#struct){ 589 - + r1: (#struct){ 590 - + a: (#struct){ 591 - + d: (#struct){ 592 - + n: (string){ "c1" } 593 - + } 594 - + k: (string){ "simple" } 595 - + } 596 - + } 597 - + } 598 - + } 599 - + k: (string){ "complex" } 600 - + } 601 - + } 602 - + } 603 - + } 604 - + k: (string){ "complex" } 605 - + } 606 - + } 607 - + } 608 - + } 609 - + k: (string){ "complex" } 610 - + } 611 - + } 612 - + out: (_|_){ 613 - + // [structural cycle] out.subs.subs.#p: structural cycle: 614 - + // ./in.cue:32:16 615 - + #p: (#struct){ 616 - + d: (#struct){ 617 - + n: (string){ "s1" } 618 - + r: (#struct){ 619 - + r1: (#struct){ 620 - + a: (#struct){ 621 - + d: (#struct){ 622 - + n: (string){ "c1" } 623 - + } 624 - + k: (string){ "simple" } 625 - + } 626 - + } 627 - + r2: (#struct){ 628 - + a: (#struct){ 629 - + d: (#struct){ 630 - + n: (string){ "s2" } 631 - + r: (#struct){ 632 - + r1: (#struct){ 633 - + a: (#struct){ 634 - + d: (#struct){ 635 - + n: (string){ "c1" } 636 - + } 637 - + k: (string){ "simple" } 638 - + } 639 - + } 640 - + r2: (#struct){ 641 - + a: (#struct){ 642 - + d: (#struct){ 643 - + n: (string){ "s3" } 644 - + r: (#struct){ 645 - + r1: (#struct){ 646 - + a: (#struct){ 647 - + d: (#struct){ 648 - + n: (string){ "c1" } 649 - + } 650 - + k: (string){ "simple" } 651 - + } 652 - + } 653 - + } 654 - + } 655 - + k: (string){ "complex" } 656 - + } 657 - + } 658 - + } 659 - + } 660 - + k: (string){ "complex" } 661 - + } 662 - + } 663 - + } 664 - + } 665 - + k: (string){ "complex" } 666 - } 667 - dict: (#struct){ 668 - r1: (#struct){ 669 - a: (#struct){ 670 - - k: (string){ "simple" } 671 - - d: (#struct){ 672 - - n: (string){ "c1" } 673 - - } 674 - - } 675 - - } 676 - - r2_r1: (#struct){ 677 - - a: (#struct){ 678 - - k: (string){ "simple" } 679 - - d: (#struct){ 680 - - n: (string){ "c1" } 681 - - } 682 - - } 683 - - } 684 - - r2_r2_r1: (#struct){ 685 - - a: (#struct){ 686 - - k: (string){ "simple" } 687 - - d: (#struct){ 688 - - n: (string){ "c1" } 689 - - } 690 - - } 691 - - } 692 - - } 693 - - let subs#1multi = (〈3;#sub〉 & { 694 - - #p: 〈2;rd〉.a 695 - - }) 696 - + d: (#struct){ 697 - + n: (string){ "c1" } 698 - + } 699 - + k: (string){ "simple" } 700 - + } 701 - + } 702 - + } 703 - + let subs#1multi = &[&[&[&[&[(〈3;#sub〉 & { 704 - + #p: 〈2;rd〉.a 705 - + })]]]]] 706 - } 707 - } 708 - -- diff/todo/p0 -- 709 - out.subs.subs.#p: invalid structural cycle 710 313 -- diff/todo/p3 -- 711 314 Reordering 712 315 -- out/evalalpha/stats -- ··· 1490 1093 out: (〈0;#sub〉 & { 1491 1094 #p: 〈1;_test〉.s1 1492 1095 }) 1493 - } 1096 + }
-22
cue/testdata/eval/let.txtar
··· 444 444 } 445 445 } 446 446 } 447 - -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 448 - diff old new 449 - --- old 450 - +++ new 451 - @@ -1,9 +1,9 @@ 452 - -Leaks: 52 453 - -Freed: 158 454 - -Reused: 149 455 - -Allocs: 61 456 - -Retain: 184 457 - +Leaks: 226 458 - +Freed: 16 459 - +Reused: 16 460 - +Allocs: 226 461 - +Retain: 0 462 - 463 - -Unifications: 196 464 - -Conjuncts: 365 465 - -Disjuncts: 241 466 - +Unifications: 210 467 - +Conjuncts: 1451 468 - +Disjuncts: 32 469 447 -- diff/-out/evalalpha<==>+out/eval -- 470 448 diff old new 471 449 --- old
+1
internal/_e2e/script_test.go
··· 91 91 p := testscript.Params{ 92 92 Dir: filepath.Join("testdata", "script"), 93 93 RequireExplicitExec: true, 94 + RequireUniqueNames: true, 94 95 Setup: func(env *testscript.Env) error { 95 96 env.Setenv("CUE_EXPERIMENT", "modules") 96 97 env.Setenv("CUE_REGISTRY", "registry.cue.works")
-3
internal/mod/modpkgload/testdata/localpackageambiguous.txtar
··· 41 41 example.com@v0 v0.0.1 (_registry/example.com_v0.0.1/blah) 42 42 local (cue.mod/gen/example.com/blah) 43 43 missing: false 44 - -- main.cue -- 45 - package main 46 - import "example.com/blah" 47 44 -- cue.mod/gen/example.com/blah/x.cue -- 48 45 package blah 49 46 -- main.cue --