From f8defbb0ddc57b3c895f571ff7d77ed2b8e6ea69 Mon Sep 17 00:00:00 2001 From: Matthew Sackman Date: Mon, 20 Jan 2025 10:50:38 +0000 Subject: [PATCH] all: enable toposort by default Signed-off-by: Matthew Sackman Change-Id: I307274073d89f189016c890db739e4305f0fa0c6 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207475 TryBot-Result: CUEcueckoo Reviewed-by: Marcel van Lohuizen Unity-Result: CUE porcuepine --- .github/workflows/evict_caches.yaml | 4 +- .github/workflows/push_tip_to_trybot.yaml | 20 +- .github/workflows/release.yaml | 12 +- .github/workflows/tip_triggers.yaml | 4 +- .github/workflows/trybot.yaml | 38 +- .github/workflows/trybot_dispatch.yaml | 4 +- cmd/cue/cmd/testdata/script/cmd_many.txtar | 20 +- cmd/cue/cmd/testdata/script/embed.txtar | 8 +- .../testdata/script/encoding_comments.txtar | 72 +- .../cmd/testdata/script/exp_gengotypes.txtar | 26 +- .../testdata/script/export_issue3511.txtar | 4 +- cmd/cue/cmd/testdata/script/hidden.txtar | 2 +- cmd/cue/cmd/testdata/script/issue269.txtar | 6 +- cmd/cue/cmd/testdata/script/issue398.txtar | 4 +- cmd/cue/cmd/testdata/script/load_pkg.txtar | 4 +- .../cmd/testdata/script/modget_initial.txtar | 4 +- .../cmd/testdata/script/modtidy_initial.txtar | 2 +- .../cmd/testdata/script/modtidy_logging.txtar | 4 +- .../cmd/testdata/script/registry_mux.txtar | 2 +- .../testdata/script/registry_mux_auth.txtar | 2 +- .../testdata/script/registry_publish.txtar | 2 +- .../script/registry_publish_auth.txtar | 2 +- .../cmd/testdata/script/registry_simple.txtar | 4 +- cmd/cue/cmd/testdata/script/sortfields.txtar | 4 +- .../wasm/testdata/cue/multiple.txtar | 10 +- cue/load/testdata/testfetch/simple.txtar | 2 +- encoding/openapi/testdata/openapi-norefs.json | 16 +- internal/core/export/export_test.go | 2 +- internal/core/export/testdata/main/adt.txtar | 123 +-- .../core/export/testdata/main/alias.txtar | 100 +- .../core/export/testdata/main/attrs.txtar | 20 +- .../core/export/testdata/main/issue662.txtar | 75 +- internal/core/export/testdata/main/let.txtar | 872 +++++++++--------- .../core/export/testdata/main/merge.txtar | 112 +-- .../core/export/testdata/main/shadow.txtar | 8 +- internal/core/runtime/testdata/basic.txtar | 2 +- internal/core/runtime/testdata/legacy.txtar | 2 +- internal/cueexperiment/exp.go | 2 +- pkg/encoding/json/testdata/gen.txtar | 4 +- pkg/list/testdata/unique.txtar | 36 +- pkg/path/testdata/os.txtar | 98 +- pkg/time/testdata/gen.txtar | 6 +- tools/flow/testdata/dep.txtar | 24 +- tools/flow/testdata/dynamic.txtar | 4 +- tools/flow/testdata/issue2416a.txtar | 44 +- tools/flow/testdata/issue2490.txtar | 17 + tools/flow/testdata/issue2517.txtar | 4 +- tools/flow/testdata/issue2965.txtar | 4 +- tools/flow/testdata/slice.txtar | 40 +- tools/flow/testdata/template.txtar | 73 +- 50 files changed, 768 insertions(+), 1186 deletions(-) diff --git a/.github/workflows/evict_caches.yaml b/.github/workflows/evict_caches.yaml index f1af8b218..55d712db6 100644 --- a/.github/workflows/evict_caches.yaml +++ b/.github/workflows/evict_caches.yaml @@ -6,11 +6,11 @@ name: Evict caches - cron: 0 2 * * * jobs: test: - if: ${{github.repository == 'cue-lang/cue'}} - runs-on: ubuntu-24.04 defaults: run: shell: bash --noprofile --norc -euo pipefail {0} + if: ${{github.repository == 'cue-lang/cue'}} + runs-on: ubuntu-24.04 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/push_tip_to_trybot.yaml b/.github/workflows/push_tip_to_trybot.yaml index f03cf4e6a..61d864c46 100644 --- a/.github/workflows/push_tip_to_trybot.yaml +++ b/.github/workflows/push_tip_to_trybot.yaml @@ -1,15 +1,13 @@ # Code generated internal/ci/ci_tool.cue; DO NOT EDIT. -name: Push tip to trybot -"on": - push: - branches: - - master - - release-branch.* concurrency: push_tip_to_trybot jobs: push: + defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} runs-on: ubuntu-24.04 + if: ${{github.repository == 'cue-lang/cue'}} steps: - name: Write netrc file for cueckoo Gerrithub run: |- @@ -45,7 +43,9 @@ jobs: echo "Giving up" exit 1 fi - defaults: - run: - shell: bash --noprofile --norc -euo pipefail {0} - if: ${{github.repository == 'cue-lang/cue'}} +name: Push tip to trybot +"on": + push: + branches: + - master + - release-branch.* diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2b9bbe7c3..910bab563 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,6 +1,7 @@ # Code generated internal/ci/ci_tool.cue; DO NOT EDIT. name: Release +concurrency: release "on": push: tags: @@ -10,14 +11,13 @@ name: Release - ci/test - master - release-branch.* -concurrency: release jobs: goreleaser: - runs-on: ubuntu-24.04 - if: ${{github.repository == 'cue-lang/cue'}} defaults: run: shell: bash --noprofile --norc -euo pipefail {0} + runs-on: ubuntu-24.04 + if: ${{github.repository == 'cue-lang/cue'}} steps: - name: Checkout code uses: actions/checkout@v4 @@ -82,13 +82,13 @@ jobs: install-only: true version: v2.5.0 - name: Run GoReleaser with CUE + env: + CUE_TOKEN: ${{ secrets.NOTCUECKOO_CUE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CUECKOO_GITHUB_PAT }} run: |- go run cuelang.org/go/cmd/cue login --token=${CUE_TOKEN} cue cmd release working-directory: ./internal/ci/goreleaser - env: - CUE_TOKEN: ${{ secrets.NOTCUECKOO_CUE_TOKEN }} - GITHUB_TOKEN: ${{ secrets.CUECKOO_GITHUB_PAT }} - if: startsWith(github.ref, 'refs/tags/v') name: Re-test cuelang.org run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"event_type\":\"Re-test post release of ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches' diff --git a/.github/workflows/tip_triggers.yaml b/.github/workflows/tip_triggers.yaml index aad7d6bfe..475a169c3 100644 --- a/.github/workflows/tip_triggers.yaml +++ b/.github/workflows/tip_triggers.yaml @@ -8,11 +8,11 @@ name: Triggers on push to tip - ci/test jobs: push: - runs-on: ubuntu-24.04 - if: ${{github.repository == 'cue-lang/cue'}} defaults: run: shell: bash --noprofile --norc -euo pipefail {0} + runs-on: ubuntu-24.04 + if: ${{github.repository == 'cue-lang/cue'}} steps: - name: Trigger unity build run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"event_type\":\"Check against ${GITHUB_SHA}\",\"client_payload\":{\"type\":\"unity\",\"payload\":{\"versions\":\"\\\"commit:${GITHUB_SHA}\\\"\"}}}" https://api.github.com/repos/cue-unity/unity-private/dispatches' diff --git a/.github/workflows/trybot.yaml b/.github/workflows/trybot.yaml index 9a7fc751e..fd8c454f7 100644 --- a/.github/workflows/trybot.yaml +++ b/.github/workflows/trybot.yaml @@ -9,10 +9,13 @@ name: TryBot - release-branch.* tags-ignore: - v* - workflow_dispatch: {} pull_request_target: {} + workflow_dispatch: {} jobs: test: + defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} strategy: fail-fast: false matrix: @@ -28,9 +31,6 @@ jobs: (contains(github.event.head_commit.message, ' Dispatch-Trailer: {"type":"trybot"')) || ! (contains(github.event.head_commit.message, ' Dispatch-Trailer: {"type":"')) - defaults: - run: - shell: bash --noprofile --norc -euo pipefail {0} steps: - name: Checkout code uses: actions/checkout@v4 @@ -117,50 +117,50 @@ jobs: run: go test ./... - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') name: Test with -race - run: go test -race ./... env: GORACE: atexit_sleep_ms=10 + run: go test -race ./... - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') name: Test on 32 bits - run: go test -short ./... env: GOARCH: "386" + run: go test -short ./... - name: Test with -tags=cuewasm run: go test -tags cuewasm ./cmd/cue/cmd ./cue/interpreter/wasm - name: gcloud auth for end-to-end tests id: auth - if: |- - github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' - Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.E2E_GCLOUD_KEY }} - - if: |- + if: |- github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') - name: gcloud setup for end-to-end tests + - name: gcloud setup for end-to-end tests uses: google-github-actions/setup-gcloud@v2 - - if: |- + if: |- github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') - name: End-to-end test + - name: End-to-end test env: CUE_TEST_TOKEN: ${{ secrets.E2E_PORCUEPINE_CUE_TOKEN }} run: |- cd internal/_e2e go test -race - - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') - name: Go checks + if: |- + github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' + Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') + - name: Go checks run: |- go vet ./... go mod tidy (cd internal/_e2e && go test -run=-) - - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') - name: staticcheck + if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') + - name: staticcheck uses: dominikh/staticcheck-action@v1 with: version: 2024.1.1 install-go: false + if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') name: Check all git tags are available run: |- @@ -179,11 +179,11 @@ jobs: fi - if: (matrix.go-version == '1.23.x' && matrix.runner == 'ubuntu-24.04') name: Generate + env: + CUE_TOKEN: ${{ secrets.NOTCUECKOO_CUE_TOKEN }} run: |- go run cuelang.org/go/cmd/cue login --token=${CUE_TOKEN} go generate ./... - env: - CUE_TOKEN: ${{ secrets.NOTCUECKOO_CUE_TOKEN }} - if: always() name: Check that git is clean at the end of the job run: test -z "$(git status --porcelain)" || (git status; git diff; false) diff --git a/.github/workflows/trybot_dispatch.yaml b/.github/workflows/trybot_dispatch.yaml index 2b29fe4ce..9dd050463 100644 --- a/.github/workflows/trybot_dispatch.yaml +++ b/.github/workflows/trybot_dispatch.yaml @@ -8,11 +8,11 @@ name: Dispatch trybot - ci/test jobs: trybot: - runs-on: ubuntu-24.04 - if: ${{ ((github.ref == 'refs/heads/ci/test') && false) || github.event.client_payload.type == 'trybot' }} defaults: run: shell: bash --noprofile --norc -euo pipefail {0} + runs-on: ubuntu-24.04 + if: ${{ ((github.ref == 'refs/heads/ci/test') && false) || github.event.client_payload.type == 'trybot' }} steps: - name: Write netrc file for cueckoo Gerrithub run: |- diff --git a/cmd/cue/cmd/testdata/script/cmd_many.txtar b/cmd/cue/cmd/testdata/script/cmd_many.txtar index bb6a28434..86aded94f 100644 --- a/cmd/cue/cmd/testdata/script/cmd_many.txtar +++ b/cmd/cue/cmd/testdata/script/cmd_many.txtar @@ -78,22 +78,22 @@ ls: a b -- stdout.export-post.golden -- { - "itemsList": [], - "items": {} + "items": {}, + "itemsList": [] } { - "itemsList": [ - "a" - ], "items": { "a": "a" - } + }, + "itemsList": [ + "a" + ] } { - "itemsList": [ - "b" - ], "items": { "b": "b" - } + }, + "itemsList": [ + "b" + ] } diff --git a/cmd/cue/cmd/testdata/script/embed.txtar b/cmd/cue/cmd/testdata/script/embed.txtar index f5e747b5a..15f091c20 100644 --- a/cmd/cue/cmd/testdata/script/embed.txtar +++ b/cmd/cue/cmd/testdata/script/embed.txtar @@ -152,12 +152,12 @@ c: """ """ d: { - "y/_test.json": { - z: 45 - } "x/input.yaml": { a1: 2 } + "y/_test.json": { + z: 45 + } "y/test.json": { x: 34 } @@ -238,8 +238,8 @@ c: """ """ d: { - "y/_test.json": z: 45 "x/input.yaml": a1: 2 + "y/_test.json": z: 45 "y/test.json": x: 34 } f: info: { diff --git a/cmd/cue/cmd/testdata/script/encoding_comments.txtar b/cmd/cue/cmd/testdata/script/encoding_comments.txtar index a5ec85381..f48c2bb92 100644 --- a/cmd/cue/cmd/testdata/script/encoding_comments.txtar +++ b/cmd/cue/cmd/testdata/script/encoding_comments.txtar @@ -169,34 +169,22 @@ _disjunction2: int // disjunction is like a sum type. disjunction: _disjunction1 | _disjunction2 -- eval-cue.stdout -- -foo: "bar" -struct: { - field1: "message1" - field2: "message2" -} +#Schema: {} Data: { name: "Foo" } -#Schema: {} -list: [1, 2, 3] +foo: "bar" implicitUnified: "some value" explicitUnified1: "some default" explicitUnified2: "some value" explicitUnified: "some value" disjunction: "some default" --- export-cue.stdout -- -// top-level comment before a simple field. -foo: "bar" - -// top-level comment before a struct struct: { - // comment in a struct field - field1: "message1" - field2: "message2" - - // comment at the end of a struct. + field1: "message1" + field2: "message2" } - +list: [1, 2, 3] +-- export-cue.stdout -- // Data fits the schema. Data: { // name is the schema name. @@ -205,8 +193,8 @@ Data: { name: "Foo" } -// top-level comment before a list. -list: [1, 2, 3] +// top-level comment before a simple field. +foo: "bar" // implicitUnified is any non-empty string. @@ -224,43 +212,55 @@ explicitUnified: "some value" // disjunction is like a sum type. disjunction: "some default" + +// top-level comment before a struct +struct: { + // comment in a struct field + field1: "message1" + field2: "message2" + + // comment at the end of a struct. +} + +// top-level comment before a list. +list: [1, 2, 3] -- export-json.stdout -- { + "Data": { + "name": "Foo" + }, "foo": "bar", + "implicitUnified": "some value", + "explicitUnified1": "some default", + "explicitUnified2": "some value", + "explicitUnified": "some value", + "disjunction": "some default", "struct": { "field1": "message1", "field2": "message2" }, - "Data": { - "name": "Foo" - }, "list": [ 1, 2, 3 - ], - "implicitUnified": "some value", - "explicitUnified1": "some default", - "explicitUnified2": "some value", - "explicitUnified": "some value", - "disjunction": "some default" + ] } -- export-yaml.stdout -- +Data: + name: Foo foo: bar +implicitUnified: some value +explicitUnified1: some default +explicitUnified2: some value +explicitUnified: some value +disjunction: some default struct: field1: message1 field2: message2 -Data: - name: Foo list: - 1 - 2 - 3 -implicitUnified: some value -explicitUnified1: some default -explicitUnified2: some value -explicitUnified: some value -disjunction: some default -- export-toml.stdout -- disjunction = 'some default' explicitUnified = 'some value' diff --git a/cmd/cue/cmd/testdata/script/exp_gengotypes.txtar b/cmd/cue/cmd/testdata/script/exp_gengotypes.txtar index 09ed4d452..f92d938f1 100644 --- a/cmd/cue/cmd/testdata/script/exp_gengotypes.txtar +++ b/cmd/cue/cmd/testdata/script/exp_gengotypes.txtar @@ -634,9 +634,6 @@ type RemoteStructs struct { MultiTwo multipkg_two.Two `json:"multiTwo,omitempty"` } -type EmptyStruct struct { -} - type Types struct { Top any/* CUE top */ `json:"Top,omitempty"` @@ -687,7 +684,20 @@ type Types struct { LinkedList *LinkedList `json:"LinkedList,omitempty"` } +type LinkedList struct { + Item any/* CUE top */ `json:"item,omitempty"` + + Next *LinkedList `json:"next,omitempty"` +} + +type EmptyStruct struct { +} + type Root struct { + Embedded1 int64 `json:"embedded1,omitempty"` + + Embedded2 int64 `json:"embedded2,omitempty"` + Types *Types `json:"types,omitempty"` Fields *struct { @@ -758,10 +768,6 @@ type Root struct { MustEqual1 int64 `json:"mustEqual1,omitempty"` - Embedded1 int64 `json:"embedded1,omitempty"` - - Embedded2 int64 `json:"embedded2,omitempty"` - MustEqual2 any/* TODO: IncompleteKind: _|_ */ `json:"mustEqual2,omitempty"` } @@ -775,12 +781,6 @@ type AttrChangedName int64 type AttrType constant.Kind -type LinkedList struct { - Item any/* CUE top */ `json:"item,omitempty"` - - Next *LinkedList `json:"next,omitempty"` -} - type Root_innerStruct struct { InnerStructField int64 `json:"innerStructField,omitempty"` } diff --git a/cmd/cue/cmd/testdata/script/export_issue3511.txtar b/cmd/cue/cmd/testdata/script/export_issue3511.txtar index a4a3f2482..d78c6157e 100644 --- a/cmd/cue/cmd/testdata/script/export_issue3511.txtar +++ b/cmd/cue/cmd/testdata/script/export_issue3511.txtar @@ -26,8 +26,8 @@ List: [{name: "kube-api-server"}] "items": [ [ { - "name": "kube-api-server", - "namespace": "default" + "namespace": "default", + "name": "kube-api-server" } ] ] diff --git a/cmd/cue/cmd/testdata/script/hidden.txtar b/cmd/cue/cmd/testdata/script/hidden.txtar index 848608b9d..0123f2620 100644 --- a/cmd/cue/cmd/testdata/script/hidden.txtar +++ b/cmd/cue/cmd/testdata/script/hidden.txtar @@ -40,7 +40,7 @@ _top: 1 a: { _h0: int } -_h2: string #foo: { _h1: string } +_h2: string diff --git a/cmd/cue/cmd/testdata/script/issue269.txtar b/cmd/cue/cmd/testdata/script/issue269.txtar index 9fa80ba48..f94e4af2a 100644 --- a/cmd/cue/cmd/testdata/script/issue269.txtar +++ b/cmd/cue/cmd/testdata/script/issue269.txtar @@ -21,21 +21,21 @@ data: { -- expect-stdout -- #type: { x: 0 + y: 0 i: 0 j: 0 - y: 0 } data: { a: { x: 0 + y: 0 i: 0 j: 0 - y: 0 } b: { x: 0 + y: 0 i: 0 j: 0 - y: 0 } } diff --git a/cmd/cue/cmd/testdata/script/issue398.txtar b/cmd/cue/cmd/testdata/script/issue398.txtar index 33a2745d6..155b8c5a3 100644 --- a/cmd/cue/cmd/testdata/script/issue398.txtar +++ b/cmd/cue/cmd/testdata/script/issue398.txtar @@ -17,6 +17,6 @@ y: 2 package baz x: 1 -- expect-stdout -- -z: 3 -y: 2 x: 1 +y: 2 +z: 3 diff --git a/cmd/cue/cmd/testdata/script/load_pkg.txtar b/cmd/cue/cmd/testdata/script/load_pkg.txtar index 89c39c267..6affef411 100644 --- a/cmd/cue/cmd/testdata/script/load_pkg.txtar +++ b/cmd/cue/cmd/testdata/script/load_pkg.txtar @@ -82,8 +82,6 @@ files: child_7: 0 files: root_3: 0 -- sort/stdout-sort -- files: { - root_1: 0 - root_3: 0 child_1: 0 child_2: 0 child_3: 0 @@ -92,5 +90,7 @@ files: { child_7: 0 grandchild_1: 0 grandchild_2: 0 + root_1: 0 + root_3: 0 } flat: ["root_1", "root_3", "child_1", "child_2", "child_3", "child_5", "child_6", "child_7", "grandchild_1", "grandchild_2"] diff --git a/cmd/cue/cmd/testdata/script/modget_initial.txtar b/cmd/cue/cmd/testdata/script/modget_initial.txtar index a94ab0517..40431f291 100644 --- a/cmd/cue/cmd/testdata/script/modget_initial.txtar +++ b/cmd/cue/cmd/testdata/script/modget_initial.txtar @@ -65,10 +65,10 @@ deps: { } -- want-stdout-1 -- { - "main": "main", "foo.com/bar/hello@v0": "v0.2.3", "bar.com@v0": "v0.5.0", "baz.org@v0": "v0.10.2", + "main": "main", "example.com@v0": "v0.0.1" } -- want-module-2 -- @@ -93,10 +93,10 @@ deps: { } -- want-stdout-2 -- { - "main": "main", "foo.com/bar/hello@v0": "v0.2.3", "bar.com@v0": "v0.5.0", "baz.org@v0": "v0.11.0-alpha", + "main": "main", "example.com@v0": "v0.0.1" } -- cue.mod/module.cue -- diff --git a/cmd/cue/cmd/testdata/script/modtidy_initial.txtar b/cmd/cue/cmd/testdata/script/modtidy_initial.txtar index 746fa7c4d..148f6bbb0 100644 --- a/cmd/cue/cmd/testdata/script/modtidy_initial.txtar +++ b/cmd/cue/cmd/testdata/script/modtidy_initial.txtar @@ -40,10 +40,10 @@ deps: { } -- want-stdout -- { - "main": "main", "foo.com/bar/hello@v0": "v0.2.3", "bar.com@v0": "v0.5.0", "baz.org@v0": "v0.10.1", + "main": "main", "example.com@v0": "v0.0.1" } -- cue.mod/module.cue -- diff --git a/cmd/cue/cmd/testdata/script/modtidy_logging.txtar b/cmd/cue/cmd/testdata/script/modtidy_logging.txtar index bb6618a6e..ec688d8fa 100644 --- a/cmd/cue/cmd/testdata/script/modtidy_logging.txtar +++ b/cmd/cue/cmd/testdata/script/modtidy_logging.txtar @@ -10,8 +10,8 @@ exec cue export . cmp stdout want-stdout -- want-stdout -- { - "main": "main", - "example.com@v0": "v0.0.1" + "example.com@v0": "v0.0.1", + "main": "main" } -- cue.mod/module.cue -- module: "main.org@v0" diff --git a/cmd/cue/cmd/testdata/script/registry_mux.txtar b/cmd/cue/cmd/testdata/script/registry_mux.txtar index 70643b3ca..62fa04f10 100644 --- a/cmd/cue/cmd/testdata/script/registry_mux.txtar +++ b/cmd/cue/cmd/testdata/script/registry_mux.txtar @@ -23,10 +23,10 @@ cmp stdout expect-stdout defaultRegistry: registry: "${CUE_REGISTRY1}" moduleRegistries: "baz.org": registry: "${CUE_REGISTRY2}" -- expect-stdout -- -main: "main" "foo.com/bar/hello@v0": "v0.2.3" "bar.com@v0": "v0.5.0" "baz.org@v0": "v0.10.1 in registry2" +main: "main" "example.com@v0": "v0.0.1" -- cue.mod/module.cue -- module: "main.org@v0" diff --git a/cmd/cue/cmd/testdata/script/registry_mux_auth.txtar b/cmd/cue/cmd/testdata/script/registry_mux_auth.txtar index 4d737089c..41ce20ccd 100644 --- a/cmd/cue/cmd/testdata/script/registry_mux_auth.txtar +++ b/cmd/cue/cmd/testdata/script/registry_mux_auth.txtar @@ -7,10 +7,10 @@ env-fill $DOCKER_CONFIG/config.json exec cue eval . cmp stdout expect-stdout -- expect-stdout -- -main: "main" "foo.com/bar/hello@v0": "v0.2.3" "bar.com@v0": "v0.5.0" "baz.org@v0": "v0.10.1 in registry2" +main: "main" "example.com@v0": "v0.0.1" -- dockerconfig/config.json -- { diff --git a/cmd/cue/cmd/testdata/script/registry_publish.txtar b/cmd/cue/cmd/testdata/script/registry_publish.txtar index ba87eb7fe..e52dccc36 100644 --- a/cmd/cue/cmd/testdata/script/registry_publish.txtar +++ b/cmd/cue/cmd/testdata/script/registry_publish.txtar @@ -16,10 +16,10 @@ env CUE_CACHE_DIR=$WORK/.tmp/different-cache stderr 'cannot fetch example.com@v0.0.1: module example.com@v0.0.1: module not found' -- expect-eval-stdout -- -main: "main" "foo.com/bar/hello@v0": "v0.2.3" "bar.com@v0": "v0.5.0" "baz.org@v0": "v0.10.1" +main: "main" "example.com@v0": "v0.0.1" -- main/cue.mod/module.cue -- module: "main.org@v0" diff --git a/cmd/cue/cmd/testdata/script/registry_publish_auth.txtar b/cmd/cue/cmd/testdata/script/registry_publish_auth.txtar index 6e570167b..67f971768 100644 --- a/cmd/cue/cmd/testdata/script/registry_publish_auth.txtar +++ b/cmd/cue/cmd/testdata/script/registry_publish_auth.txtar @@ -24,8 +24,8 @@ cmp stdout ../expect-eval-stdout } -- expect-eval-stdout -- -main: "main" "example.com@v0": "v0.0.1" +main: "main" -- main/cue.mod/module.cue -- module: "main.org" language: version: "v0.9.0-alpha.0" diff --git a/cmd/cue/cmd/testdata/script/registry_simple.txtar b/cmd/cue/cmd/testdata/script/registry_simple.txtar index a8c02fd99..49208d721 100644 --- a/cmd/cue/cmd/testdata/script/registry_simple.txtar +++ b/cmd/cue/cmd/testdata/script/registry_simple.txtar @@ -9,17 +9,17 @@ exec cue trim . exec cue vet . exec cue fmt . -- expect-stdout -- -main: "main" "foo.com/bar/hello@v0": "v0.2.3" "bar.com@v0": "v0.5.0" "baz.org@v0": "v0.10.1" +main: "main" "example.com@v0": "v0.0.1" -- expect-stdout-json -- { - "main": "main", "foo.com/bar/hello@v0": "v0.2.3", "bar.com@v0": "v0.5.0", "baz.org@v0": "v0.10.1", + "main": "main", "example.com@v0": "v0.0.1" } -- cue.mod/module.cue -- diff --git a/cmd/cue/cmd/testdata/script/sortfields.txtar b/cmd/cue/cmd/testdata/script/sortfields.txtar index 5c7ce687b..e9c3f6ec3 100644 --- a/cmd/cue/cmd/testdata/script/sortfields.txtar +++ b/cmd/cue/cmd/testdata/script/sortfields.txtar @@ -43,8 +43,8 @@ b: y: true "c": true, "b": { "x": true, - "y": true, - "z": true + "z": true, + "y": true }, "a": true } diff --git a/cue/interpreter/wasm/testdata/cue/multiple.txtar b/cue/interpreter/wasm/testdata/cue/multiple.txtar index 6cea280e9..65eceedb3 100644 --- a/cue/interpreter/wasm/testdata/cue/multiple.txtar +++ b/cue/interpreter/wasm/testdata/cue/multiple.txtar @@ -30,15 +30,15 @@ c2: fact(9) -- basic.wasm -- -- basic1.wasm -- -- out/wasm -- -neg32: neg32() -add: add -x0: 3 -x1: 1 isPrime: is_prime() fact: fact() a0: -42 b1: true b2: false c1: 5040 -x2: 101 c2: 362880 +neg32: neg32() +add: add +x0: 3 +x1: 1 +x2: 101 diff --git a/cue/load/testdata/testfetch/simple.txtar b/cue/load/testdata/testfetch/simple.txtar index c8f3a3aa4..262edf54f 100644 --- a/cue/load/testdata/testfetch/simple.txtar +++ b/cue/load/testdata/testfetch/simple.txtar @@ -1,9 +1,9 @@ -- out/modfetch -- { - main: "main" "foo.com/bar/hello@v0": "v0.2.3" "bar.com@v0": "v0.5.0" "baz.org@v0": "v0.10.1" + main: "main" "example.com@v0": "v0.0.1" } -- cue.mod/module.cue -- diff --git a/encoding/openapi/testdata/openapi-norefs.json b/encoding/openapi/testdata/openapi-norefs.json index b4112f913..69a9f98a8 100644 --- a/encoding/openapi/testdata/openapi-norefs.json +++ b/encoding/openapi/testdata/openapi-norefs.json @@ -114,6 +114,12 @@ "maximum": 1000, "exclusiveMaximum": true }, + "bar": { + "type": "array", + "items": { + "type": "string" + } + }, "a": { "description": "Field a.", "type": "integer", @@ -121,12 +127,6 @@ 1 ] }, - "bar": { - "type": "array", - "items": { - "type": "string" - } - }, "b": { "type": "string" } @@ -165,10 +165,10 @@ "YourMessage": { "type": "object", "properties": { + "b": {}, "a": { "type": "string" - }, - "b": {} + } }, "oneOf": [ { diff --git a/internal/core/export/export_test.go b/internal/core/export/export_test.go index 591d89e13..602da4d50 100644 --- a/internal/core/export/export_test.go +++ b/internal/core/export/export_test.go @@ -91,7 +91,7 @@ func TestGenerated(t *testing.T) { } return convert.GoValueToValue(ctx, in, false), nil }, - out: `Terminals: [{Name: "Name", Description: "Desc"}]`, + out: `Terminals: [{Description: "Desc", Name: "Name"}]`, }, { in: func(ctx *adt.OpContext) (adt.Expr, error) { in := &C{ diff --git a/internal/core/export/testdata/main/adt.txtar b/internal/core/export/testdata/main/adt.txtar index 3832c035f..528d57dd4 100644 --- a/internal/core/export/testdata/main/adt.txtar +++ b/internal/core/export/testdata/main/adt.txtar @@ -438,125 +438,6 @@ diff old new [errorListDef #Def] [errorListDef 0] [errorListDef 1] --- diff/value/todo/p3 -- -Error message change. --- out/value-v3 -- -== Simplified -_|_ // e3: index out of range [2] with length 2 -== Raw -_|_ // e3: index out of range [2] with length 2 -== Final -_|_ // e3: index out of range [2] with length 2 -== All -{ - @foo(bar) - p1: {} - d1: { - foobar: int - } - bar: "bar" - d2: { - foobar: { - name: "xx" - foo: "xx" - } - } - - // Issue #1910 - a: _ - comp: { - for k, v in [0] - let w = v { - "\(a)": w - "bar": w - } - } - bytes: '\xeb \x1a\xf5\xaa\xf0\xd6\x06)' - c1: true - s1: """ - multi - bar - line - """ - l1: [3, ...int] - l2: [...int] - l3: [] - l4: [1, 2] - l5: { - #foo: int - [1, 3] - } - #foo: int - l6: { - #foo: int - [1, 3] - } - n1: 1.0 - n10: 10 - - // t is true - t: true - e1: <1.0 - e2: >1.0 & <10 - e3: _|_ // e3: index out of range [2] with length 2 - e4: _|_ // e4: index 3 out of range - e5: _|_ // e3: index out of range [2] with length 2 - e6: false - e7: true - e8?: true - m1: { - // foo is an optional field - foo?: 3 - - // bar is a field - bar: 4 - - // baz is a required field. - baz!: 5 - } - y1: { - src: [1, 2, 3] - foo0: 1 - foo1: 2 - foo2: 3 - bar1: 2 - x: [1, 2, 3] - bar2: 3 - } - preserveKeyFieldInComprehension: 1 - errorStructDef: { - a: 1 - b: _|_ // errorStructDef.b: conflicting values 2 and 1 - #Def: 1 - } - errorList: [1, _|_] - x: int - errorListDef: { - #Def: 1 - [1, _|_] - } -} -== Eval -_|_ // e3: index out of range [2] with length 2 --- diff/-out/value-v3<==>+out/value -- -diff old new ---- old -+++ new -@@ -74,11 +74,11 @@ - y1: { - src: [1, 2, 3] - foo0: 1 -- bar1: 2 -- bar2: 3 - foo1: 2 -- x: [1, 2, 3] - foo2: 3 -+ bar1: 2 -+ x: [1, 2, 3] -+ bar2: 3 - } - preserveKeyFieldInComprehension: 1 - errorStructDef: { -- out/value -- == Simplified _|_ // e3: index out of range [2] with length 2 @@ -631,14 +512,15 @@ _|_ // e3: index out of range [2] with length 2 // baz is a required field. baz!: 5 } + x: int y1: { src: [1, 2, 3] foo0: 1 bar1: 2 bar2: 3 foo1: 2 - x: [1, 2, 3] foo2: 3 + x: [1, 2, 3] } preserveKeyFieldInComprehension: 1 errorStructDef: { @@ -647,7 +529,6 @@ _|_ // e3: index out of range [2] with length 2 #Def: 1 } errorList: [1, _|_] - x: int errorListDef: { #Def: 1 [1, _|_] diff --git a/internal/core/export/testdata/main/alias.txtar b/internal/core/export/testdata/main/alias.txtar index a8ced3a4a..030a74e5f 100644 --- a/internal/core/export/testdata/main/alias.txtar +++ b/internal/core/export/testdata/main/alias.txtar @@ -203,15 +203,15 @@ was known to compile and is known to be correct. == Simplified { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -258,25 +258,25 @@ was known to compile and is known to be correct. // TODO: these could be merged into a single struct. issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } == Raw { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 bar?: 5 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -327,24 +327,24 @@ was known to compile and is known to be correct. // TODO: these could be merged into a single struct. issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } == Final { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -378,25 +378,25 @@ was known to compile and is known to be correct. } issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } == All { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 bar?: 5 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -447,25 +447,25 @@ was known to compile and is known to be correct. // TODO: these could be merged into a single struct. issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } == Eval { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 bar?: 5 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -501,9 +501,9 @@ was known to compile and is known to be correct. } issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } @@ -527,15 +527,15 @@ Reorderings? == Simplified { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -582,25 +582,25 @@ Reorderings? // TODO: these could be merged into a single struct. issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } == Raw { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 bar?: 5 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -651,24 +651,24 @@ Reorderings? // TODO: these could be merged into a single struct. issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } == Final { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -702,25 +702,25 @@ Reorderings? } issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } == All { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 bar?: 5 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -771,25 +771,25 @@ Reorderings? // TODO: these could be merged into a single struct. issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } == Eval { fieldAlias: { + cross: { + baz: 3 + "d-2": {} + } simple: { "a-b": 4 foo: 4 bar?: 5 "a-c": 5 } - cross: { - baz: 3 - "d-2": {} - } } valueAlias: { merge: { @@ -825,9 +825,9 @@ Reorderings? } issue2374: { a: { - r: 0 z: 1 b: null + r: 0 } } } diff --git a/internal/core/export/testdata/main/attrs.txtar b/internal/core/export/testdata/main/attrs.txtar index e15d61537..ecae9f875 100644 --- a/internal/core/export/testdata/main/attrs.txtar +++ b/internal/core/export/testdata/main/attrs.txtar @@ -233,8 +233,8 @@ dynamicSimple: { c3: {} } dynamicComplex: { - foo: "foo" a: "foo" + foo: "foo" } dynamicSimple: { a: "foo" @@ -273,8 +273,8 @@ dynamicSimple: { c3: {} } dynamicComplex: { - foo: "foo" a: "foo" + foo: "foo" b?: "foo" } dynamicSimple: { @@ -311,8 +311,8 @@ dynamicSimple: { c3: {} } dynamicComplex: { - foo: "foo" a: "foo" + foo: "foo" } dynamicSimple: { a: "foo" @@ -376,8 +376,8 @@ dynamicSimple: { c3: {} @step(3) } dynamicComplex: { - foo: "foo" @step(1) @step(2) a: "foo" @step(3) @step(2) + foo: "foo" @step(1) @step(2) b?: "foo" @step(4) @step(2) } dynamicSimple: { @@ -441,8 +441,8 @@ dynamicSimple: { c3: {} @step(3) } dynamicComplex: { - foo: "foo" @step(1) @step(2) a: "foo" @step(3) @step(2) + foo: "foo" @step(1) @step(2) b?: "foo" @step(4) @step(2) } dynamicSimple: { @@ -520,8 +520,8 @@ Reordering of attributes. c3: {} } dynamicComplex: { - foo: "foo" a: "foo" + foo: "foo" } dynamicSimple: { a: "foo" @@ -560,8 +560,8 @@ Reordering of attributes. c3: {} } dynamicComplex: { - foo: "foo" a: "foo" + foo: "foo" b?: "foo" } dynamicSimple: { @@ -598,8 +598,8 @@ Reordering of attributes. c3: {} } dynamicComplex: { - foo: "foo" a: "foo" + foo: "foo" } dynamicSimple: { a: "foo" @@ -663,8 +663,8 @@ Reordering of attributes. c3: {} @step(3) } dynamicComplex: { - foo: "foo" @step(1) @step(2) a: "foo" @step(3) @step(2) + foo: "foo" @step(1) @step(2) b?: "foo" @step(4) @step(2) } dynamicSimple: { @@ -728,8 +728,8 @@ Reordering of attributes. c3: {} @step(3) } dynamicComplex: { - foo: "foo" @step(1) @step(2) a: "foo" @step(3) @step(2) + foo: "foo" @step(1) @step(2) b?: "foo" @step(4) @step(2) } dynamicSimple: { diff --git a/internal/core/export/testdata/main/issue662.txtar b/internal/core/export/testdata/main/issue662.txtar index c3c8318be..6108ed11f 100644 --- a/internal/core/export/testdata/main/issue662.txtar +++ b/internal/core/export/testdata/main/issue662.txtar @@ -41,7 +41,7 @@ reordering [#GraphFieldConfig] [#GraphFieldConfig lineColor] [#GraphFieldConfig drawStyle] --- out/value-v3 -- +-- out/value -- == Simplified {} == Raw @@ -76,76 +76,3 @@ reordering lineColor?: string } } --- diff/-out/value-v3<==>+out/value -- -diff old new ---- old -+++ new -@@ -6,8 +6,8 @@ - lineColor?: string - } - #GraphFieldConfig: { -- lineColor?: string -- drawStyle?: int -+ drawStyle?: int -+ lineColor?: string - } - } - == Final -@@ -18,8 +18,8 @@ - lineColor?: string - } - #GraphFieldConfig: { -- lineColor?: string -- drawStyle?: int -+ drawStyle?: int -+ lineColor?: string - } - } - == Eval -@@ -28,7 +28,7 @@ - lineColor?: string - } - #GraphFieldConfig: { -- lineColor?: string -- drawStyle?: int -+ drawStyle?: int -+ lineColor?: string - } - } --- diff/value/explanation -- -reordering --- out/value -- -== Simplified -{} -== Raw -{ - #LineConfig: { - lineColor?: string - } - #GraphFieldConfig: { - lineColor?: string - drawStyle?: int - } -} -== Final -{} -== All -{ - #LineConfig: { - lineColor?: string - } - #GraphFieldConfig: { - lineColor?: string - drawStyle?: int - } -} -== Eval -{ - #LineConfig: { - lineColor?: string - } - #GraphFieldConfig: { - lineColor?: string - drawStyle?: int - } -} diff --git a/internal/core/export/testdata/main/let.txtar b/internal/core/export/testdata/main/let.txtar index 818ccb0fa..4eb06279b 100644 --- a/internal/core/export/testdata/main/let.txtar +++ b/internal/core/export/testdata/main/let.txtar @@ -367,6 +367,21 @@ y: Y & Y_1 -- out/value-v3 -- == Simplified { + cfgs: [{ + metadata: { + name: "one" + } + }, { + metadata: { + name: "two" + } + }] + complete: { + x: "a foo z" + run: { + a: "foo" + } + } comprehension: { for cfg in [{ a: "one" @@ -377,49 +392,11 @@ y: Y & Y_1 } } } - complete: { - x: "a foo z" - run: { - a: "foo" - } - } - cfgs: [{ - metadata: { - name: "one" - } - }, { - metadata: { - name: "two" - } - }] files: { "\("kind-\(cfg.name)")": { patches: cfg } } - scoped: { - direct: { - a: 1 - } - embed1: { - a: 1 - } - embed2: { - a: 1 - } - list: { - a: [1] - } - listStruct: { - a: [{ - a: 1 - }] - } - listEmbed: { - a: [1] - } - } - x: "foo" incomplete: { a: { x: "a \(run.a) z" @@ -437,11 +414,11 @@ y: Y & Y_1 c: { let A_1 = run.a let A_2 = run2.a - x: "a \(A_1) z" - x2: "a \(A_2) z" + x: "a \(A_1) z" run: { a: string } + x2: "a \(A_2) z" run2: { a: string } @@ -449,56 +426,17 @@ y: Y & Y_1 d: { let A_3 = run.a let A_4 = run2.a - x: "a \(A_3) z" - x2: "a \(A_4) z" + x: "a \(A_3) z" run: { a: string } + x2: "a \(A_4) z" run2: { a: string } } } - unresolvedDisjunction: {} - y: "foo" -} -== Raw -{ - comprehension: { - for cfg in [{ - a: "one" - }] { - let filepath = "kind-\(cfg.name)" - "\(filepath)": { - patches: cfg - } - } - } - #Foo: 2 - complete: { - x: "a foo z" - run: { - a: "foo" - } - } - cfgs: [{ - metadata: { - name: "one" - } - }, { - metadata: { - name: "two" - } - }] - files: { - "\("kind-\(cfg.name)")": { - patches: cfg - } - } scoped: { - _args: { - required: 1 - } direct: { a: 1 } @@ -520,7 +458,43 @@ y: Y & Y_1 a: [1] } } + unresolvedDisjunction: {} x: "foo" + y: "foo" +} +== Raw +{ + #Foo: 2 + cfgs: [{ + metadata: { + name: "one" + } + }, { + metadata: { + name: "two" + } + }] + complete: { + x: "a foo z" + run: { + a: "foo" + } + } + comprehension: { + for cfg in [{ + a: "one" + }] { + let filepath = "kind-\(cfg.name)" + "\(filepath)": { + patches: cfg + } + } + } + files: { + "\("kind-\(cfg.name)")": { + patches: cfg + } + } incomplete: { a: { x: "a \(run.a) z" @@ -538,11 +512,11 @@ y: Y & Y_1 c: { let A_1 = run.a let A_2 = run2.a - x: "a \(A_1) z" - x2: "a \(A_2) z" + x: "a \(A_1) z" run: { a: string } + x2: "a \(A_2) z" run2: { a: string } @@ -550,16 +524,41 @@ y: Y & Y_1 d: { let A_3 = run.a let A_4 = run2.a - x: "a \(A_3) z" - x2: "a \(A_4) z" + x: "a \(A_3) z" run: { a: string } + x2: "a \(A_4) z" run2: { a: string } } } + scoped: { + _args: { + required: 1 + } + direct: { + a: 1 + } + embed1: { + a: 1 + } + embed2: { + a: 1 + } + list: { + a: [1] + } + listStruct: { + a: [{ + a: 1 + }] + } + listEmbed: { + a: [1] + } + } unresolvedDisjunction: { #TypePrimitive: { _args: { @@ -579,17 +578,11 @@ y: Y & Y_1 } } } + x: "foo" y: "foo" } == Final { - comprehension: _|_ // comprehension: key value of dynamic field must be concrete, found _|_(invalid interpolation: invalid interpolation: comprehension.filepath: undefined field: name) (and 1 more errors) - complete: { - x: "a foo z" - run: { - a: "foo" - } - } cfgs: [{ metadata: { name: "one" @@ -599,30 +592,14 @@ y: Y & Y_1 name: "two" } }] - files: _|_ // files: key value of dynamic field must be concrete, found _|_(invalid interpolation: invalid interpolation: filepath: undefined field: name) (and 3 more errors) - scoped: { - direct: { - a: 1 - } - embed1: { - a: 1 - } - embed2: { - a: 1 - } - list: { - a: [1] - } - listStruct: { - a: [{ - a: 1 - }] - } - listEmbed: { - a: [1] + complete: { + x: "a foo z" + run: { + a: "foo" } } - x: "foo" + comprehension: _|_ // comprehension: key value of dynamic field must be concrete, found _|_(invalid interpolation: invalid interpolation: comprehension.filepath: undefined field: name) (and 1 more errors) + files: _|_ // files: key value of dynamic field must be concrete, found _|_(invalid interpolation: invalid interpolation: filepath: undefined field: name) (and 3 more errors) incomplete: { a: { x: _|_ // invalid interpolation: incomplete.a.x: non-concrete value string (type string) @@ -637,66 +614,27 @@ y: Y & Y_1 } } c: { - x: _|_ // invalid interpolation: incomplete.c.x: non-concrete value string (type string) - x2: _|_ // invalid interpolation: incomplete.c.x2: non-concrete value string (type string) + x: _|_ // invalid interpolation: incomplete.c.x: non-concrete value string (type string) run: { a: string } + x2: _|_ // invalid interpolation: incomplete.c.x2: non-concrete value string (type string) run2: { a: string } } d: { - x: _|_ // invalid interpolation: incomplete.d.x: non-concrete value string (type string) - x2: _|_ // invalid interpolation: incomplete.d.x2: non-concrete value string (type string) + x: _|_ // invalid interpolation: incomplete.d.x: non-concrete value string (type string) run: { a: string } + x2: _|_ // invalid interpolation: incomplete.d.x2: non-concrete value string (type string) run2: { a: string } } } - unresolvedDisjunction: {} - y: "foo" -} -== All -{ - comprehension: { - for cfg in [{ - a: "one" - }] { - let filepath = "kind-\(cfg.name)" - "\(filepath)": { - patches: cfg - } - } - } - #Foo: 2 - complete: { - x: "a foo z" - run: { - a: "foo" - } - } - cfgs: [{ - metadata: { - name: "one" - } - }, { - metadata: { - name: "two" - } - }] - files: { - "\("kind-\(cfg.name)")": { - patches: cfg - } - } scoped: { - _args: { - required: 1 - } direct: { a: 1 } @@ -714,11 +652,47 @@ y: Y & Y_1 a: 1 }] } - listEmbed: { - a: [1] + listEmbed: { + a: [1] + } + } + unresolvedDisjunction: {} + x: "foo" + y: "foo" +} +== All +{ + #Foo: 2 + cfgs: [{ + metadata: { + name: "one" + } + }, { + metadata: { + name: "two" + } + }] + complete: { + x: "a foo z" + run: { + a: "foo" + } + } + comprehension: { + for cfg in [{ + a: "one" + }] { + let filepath = "kind-\(cfg.name)" + "\(filepath)": { + patches: cfg + } + } + } + files: { + "\("kind-\(cfg.name)")": { + patches: cfg } } - x: "foo" incomplete: { a: { x: "a \(run.a) z" @@ -736,11 +710,11 @@ y: Y & Y_1 c: { let A_1 = run.a let A_2 = run2.a - x: "a \(A_1) z" - x2: "a \(A_2) z" + x: "a \(A_1) z" run: { a: string } + x2: "a \(A_2) z" run2: { a: string } @@ -748,16 +722,41 @@ y: Y & Y_1 d: { let A_3 = run.a let A_4 = run2.a - x: "a \(A_3) z" - x2: "a \(A_4) z" + x: "a \(A_3) z" run: { a: string } + x2: "a \(A_4) z" run2: { a: string } } } + scoped: { + _args: { + required: 1 + } + direct: { + a: 1 + } + embed1: { + a: 1 + } + embed2: { + a: 1 + } + list: { + a: [1] + } + listStruct: { + a: [{ + a: 1 + }] + } + listEmbed: { + a: [1] + } + } unresolvedDisjunction: { #TypePrimitive: { _args: { @@ -777,27 +776,12 @@ y: Y & Y_1 } } } + x: "foo" y: "foo" } == Eval { - comprehension: { - for cfg in [{ - a: "one" - }] { - let filepath = "kind-\(cfg.name)" - "\(filepath)": { - patches: cfg - } - } - } #Foo: 2 - complete: { - x: "a foo z" - run: { - a: "foo" - } - } cfgs: [{ metadata: { name: "one" @@ -807,34 +791,27 @@ y: Y & Y_1 name: "two" } }] - files: { - "\("kind-\(cfg.name)")": { - patches: cfg + complete: { + x: "a foo z" + run: { + a: "foo" } } - scoped: { - direct: { - a: 1 - } - embed1: { - a: 1 - } - embed2: { - a: 1 - } - list: { - a: [1] - } - listStruct: { - a: [{ - a: 1 - }] + comprehension: { + for cfg in [{ + a: "one" + }] { + let filepath = "kind-\(cfg.name)" + "\(filepath)": { + patches: cfg + } } - listEmbed: { - a: [1] + } + files: { + "\("kind-\(cfg.name)")": { + patches: cfg } } - x: "foo" incomplete: { a: { x: "a \(run.a) z" @@ -852,11 +829,11 @@ y: Y & Y_1 c: { let A_1 = run.a let A_2 = run2.a - x: "a \(A_1) z" - x2: "a \(A_2) z" + x: "a \(A_1) z" run: { a: string } + x2: "a \(A_2) z" run2: { a: string } @@ -864,16 +841,38 @@ y: Y & Y_1 d: { let A_3 = run.a let A_4 = run2.a - x: "a \(A_3) z" - x2: "a \(A_4) z" + x: "a \(A_3) z" run: { a: string } + x2: "a \(A_4) z" run2: { a: string } } } + scoped: { + direct: { + a: 1 + } + embed1: { + a: 1 + } + embed2: { + a: 1 + } + list: { + a: [1] + } + listStruct: { + a: [{ + a: 1 + }] + } + listEmbed: { + a: [1] + } + } unresolvedDisjunction: { #TypePrimitive: { "*": {} @@ -889,58 +888,44 @@ y: Y & Y_1 } } } + x: "foo" y: "foo" } -- diff/-out/value-v3<==>+out/value -- diff old new --- old +++ new -@@ -216,23 +216,23 @@ - } - == Final - { +@@ -231,8 +231,8 @@ + a: "foo" + } + } - comprehension: _|_ // invalid interpolation: cycle error -- complete: { -- x: "a foo z" -- run: { -- a: "foo" -- } -- } -- cfgs: [{ -- metadata: { -- name: "one" -- } -- }, { -- metadata: { -- name: "two" -- } -- }] -- files: _|_ // invalid interpolation: cycle error (and 1 more errors) +- files: _|_ // invalid interpolation: cycle error (and 1 more errors) + comprehension: _|_ // comprehension: key value of dynamic field must be concrete, found _|_(invalid interpolation: invalid interpolation: comprehension.filepath: undefined field: name) (and 1 more errors) -+ complete: { -+ x: "a foo z" -+ run: { -+ a: "foo" -+ } -+ } -+ cfgs: [{ -+ metadata: { -+ name: "one" -+ } -+ }, { -+ metadata: { -+ name: "two" -+ } -+ }] -+ files: _|_ // files: key value of dynamic field must be concrete, found _|_(invalid interpolation: invalid interpolation: filepath: undefined field: name) (and 3 more errors) - scoped: { - direct: { - a: 1 ++ files: _|_ // files: key value of dynamic field must be concrete, found _|_(invalid interpolation: invalid interpolation: filepath: undefined field: name) (and 3 more errors) + incomplete: { + a: { + x: _|_ // invalid interpolation: incomplete.a.x: non-concrete value string (type string) -- diff/value/explanation -- Improved error messages. -- out/value -- == Simplified { + cfgs: [{ + metadata: { + name: "one" + } + }, { + metadata: { + name: "two" + } + }] + complete: { + x: "a foo z" + run: { + a: "foo" + } + } comprehension: { for cfg in [{ a: "one" @@ -951,49 +936,11 @@ Improved error messages. } } } - complete: { - x: "a foo z" - run: { - a: "foo" - } - } - cfgs: [{ - metadata: { - name: "one" - } - }, { - metadata: { - name: "two" - } - }] files: { "\("kind-\(cfg.name)")": { patches: cfg } } - scoped: { - direct: { - a: 1 - } - embed1: { - a: 1 - } - embed2: { - a: 1 - } - list: { - a: [1] - } - listStruct: { - a: [{ - a: 1 - }] - } - listEmbed: { - a: [1] - } - } - x: "foo" incomplete: { a: { x: "a \(run.a) z" @@ -1011,11 +958,11 @@ Improved error messages. c: { let A_1 = run.a let A_2 = run2.a - x: "a \(A_1) z" - x2: "a \(A_2) z" + x: "a \(A_1) z" run: { a: string } + x2: "a \(A_2) z" run2: { a: string } @@ -1023,56 +970,17 @@ Improved error messages. d: { let A_3 = run.a let A_4 = run2.a - x: "a \(A_3) z" - x2: "a \(A_4) z" + x: "a \(A_3) z" run: { a: string } + x2: "a \(A_4) z" run2: { a: string } } } - unresolvedDisjunction: {} - y: "foo" -} -== Raw -{ - comprehension: { - for cfg in [{ - a: "one" - }] { - let filepath = "kind-\(cfg.name)" - "\(filepath)": { - patches: cfg - } - } - } - #Foo: 2 - complete: { - x: "a foo z" - run: { - a: "foo" - } - } - cfgs: [{ - metadata: { - name: "one" - } - }, { - metadata: { - name: "two" - } - }] - files: { - "\("kind-\(cfg.name)")": { - patches: cfg - } - } scoped: { - _args: { - required: 1 - } direct: { a: 1 } @@ -1094,7 +1002,43 @@ Improved error messages. a: [1] } } - x: "foo" + unresolvedDisjunction: {} + x: "foo" + y: "foo" +} +== Raw +{ + #Foo: 2 + cfgs: [{ + metadata: { + name: "one" + } + }, { + metadata: { + name: "two" + } + }] + complete: { + x: "a foo z" + run: { + a: "foo" + } + } + comprehension: { + for cfg in [{ + a: "one" + }] { + let filepath = "kind-\(cfg.name)" + "\(filepath)": { + patches: cfg + } + } + } + files: { + "\("kind-\(cfg.name)")": { + patches: cfg + } + } incomplete: { a: { x: "a \(run.a) z" @@ -1112,11 +1056,11 @@ Improved error messages. c: { let A_1 = run.a let A_2 = run2.a - x: "a \(A_1) z" - x2: "a \(A_2) z" + x: "a \(A_1) z" run: { a: string } + x2: "a \(A_2) z" run2: { a: string } @@ -1124,16 +1068,41 @@ Improved error messages. d: { let A_3 = run.a let A_4 = run2.a - x: "a \(A_3) z" - x2: "a \(A_4) z" + x: "a \(A_3) z" run: { a: string } + x2: "a \(A_4) z" run2: { a: string } } } + scoped: { + _args: { + required: 1 + } + direct: { + a: 1 + } + embed1: { + a: 1 + } + embed2: { + a: 1 + } + list: { + a: [1] + } + listStruct: { + a: [{ + a: 1 + }] + } + listEmbed: { + a: [1] + } + } unresolvedDisjunction: { #TypePrimitive: { _args: { @@ -1153,17 +1122,11 @@ Improved error messages. } } } + x: "foo" y: "foo" } == Final { - comprehension: _|_ // invalid interpolation: cycle error - complete: { - x: "a foo z" - run: { - a: "foo" - } - } cfgs: [{ metadata: { name: "one" @@ -1173,30 +1136,14 @@ Improved error messages. name: "two" } }] - files: _|_ // invalid interpolation: cycle error (and 1 more errors) - scoped: { - direct: { - a: 1 - } - embed1: { - a: 1 - } - embed2: { - a: 1 - } - list: { - a: [1] - } - listStruct: { - a: [{ - a: 1 - }] - } - listEmbed: { - a: [1] + complete: { + x: "a foo z" + run: { + a: "foo" } } - x: "foo" + comprehension: _|_ // invalid interpolation: cycle error + files: _|_ // invalid interpolation: cycle error (and 1 more errors) incomplete: { a: { x: _|_ // invalid interpolation: incomplete.a.x: non-concrete value string (type string) @@ -1211,66 +1158,27 @@ Improved error messages. } } c: { - x: _|_ // invalid interpolation: incomplete.c.x: non-concrete value string (type string) - x2: _|_ // invalid interpolation: incomplete.c.x2: non-concrete value string (type string) + x: _|_ // invalid interpolation: incomplete.c.x: non-concrete value string (type string) run: { a: string } + x2: _|_ // invalid interpolation: incomplete.c.x2: non-concrete value string (type string) run2: { a: string } } d: { - x: _|_ // invalid interpolation: incomplete.d.x: non-concrete value string (type string) - x2: _|_ // invalid interpolation: incomplete.d.x2: non-concrete value string (type string) + x: _|_ // invalid interpolation: incomplete.d.x: non-concrete value string (type string) run: { a: string } + x2: _|_ // invalid interpolation: incomplete.d.x2: non-concrete value string (type string) run2: { a: string } } } - unresolvedDisjunction: {} - y: "foo" -} -== All -{ - comprehension: { - for cfg in [{ - a: "one" - }] { - let filepath = "kind-\(cfg.name)" - "\(filepath)": { - patches: cfg - } - } - } - #Foo: 2 - complete: { - x: "a foo z" - run: { - a: "foo" - } - } - cfgs: [{ - metadata: { - name: "one" - } - }, { - metadata: { - name: "two" - } - }] - files: { - "\("kind-\(cfg.name)")": { - patches: cfg - } - } scoped: { - _args: { - required: 1 - } direct: { a: 1 } @@ -1292,7 +1200,43 @@ Improved error messages. a: [1] } } + unresolvedDisjunction: {} x: "foo" + y: "foo" +} +== All +{ + #Foo: 2 + cfgs: [{ + metadata: { + name: "one" + } + }, { + metadata: { + name: "two" + } + }] + complete: { + x: "a foo z" + run: { + a: "foo" + } + } + comprehension: { + for cfg in [{ + a: "one" + }] { + let filepath = "kind-\(cfg.name)" + "\(filepath)": { + patches: cfg + } + } + } + files: { + "\("kind-\(cfg.name)")": { + patches: cfg + } + } incomplete: { a: { x: "a \(run.a) z" @@ -1310,11 +1254,11 @@ Improved error messages. c: { let A_1 = run.a let A_2 = run2.a - x: "a \(A_1) z" - x2: "a \(A_2) z" + x: "a \(A_1) z" run: { a: string } + x2: "a \(A_2) z" run2: { a: string } @@ -1322,16 +1266,41 @@ Improved error messages. d: { let A_3 = run.a let A_4 = run2.a - x: "a \(A_3) z" - x2: "a \(A_4) z" + x: "a \(A_3) z" run: { a: string } + x2: "a \(A_4) z" run2: { a: string } } } + scoped: { + _args: { + required: 1 + } + direct: { + a: 1 + } + embed1: { + a: 1 + } + embed2: { + a: 1 + } + list: { + a: [1] + } + listStruct: { + a: [{ + a: 1 + }] + } + listEmbed: { + a: [1] + } + } unresolvedDisjunction: { #TypePrimitive: { _args: { @@ -1351,27 +1320,12 @@ Improved error messages. } } } + x: "foo" y: "foo" } == Eval { - comprehension: { - for cfg in [{ - a: "one" - }] { - let filepath = "kind-\(cfg.name)" - "\(filepath)": { - patches: cfg - } - } - } #Foo: 2 - complete: { - x: "a foo z" - run: { - a: "foo" - } - } cfgs: [{ metadata: { name: "one" @@ -1381,34 +1335,27 @@ Improved error messages. name: "two" } }] - files: { - "\("kind-\(cfg.name)")": { - patches: cfg + complete: { + x: "a foo z" + run: { + a: "foo" } } - scoped: { - direct: { - a: 1 - } - embed1: { - a: 1 - } - embed2: { - a: 1 - } - list: { - a: [1] - } - listStruct: { - a: [{ - a: 1 - }] + comprehension: { + for cfg in [{ + a: "one" + }] { + let filepath = "kind-\(cfg.name)" + "\(filepath)": { + patches: cfg + } } - listEmbed: { - a: [1] + } + files: { + "\("kind-\(cfg.name)")": { + patches: cfg } } - x: "foo" incomplete: { a: { x: "a \(run.a) z" @@ -1426,11 +1373,11 @@ Improved error messages. c: { let A_1 = run.a let A_2 = run2.a - x: "a \(A_1) z" - x2: "a \(A_2) z" + x: "a \(A_1) z" run: { a: string } + x2: "a \(A_2) z" run2: { a: string } @@ -1438,16 +1385,38 @@ Improved error messages. d: { let A_3 = run.a let A_4 = run2.a - x: "a \(A_3) z" - x2: "a \(A_4) z" + x: "a \(A_3) z" run: { a: string } + x2: "a \(A_4) z" run2: { a: string } } } + scoped: { + direct: { + a: 1 + } + embed1: { + a: 1 + } + embed2: { + a: 1 + } + list: { + a: [1] + } + listStruct: { + a: [{ + a: 1 + }] + } + listEmbed: { + a: [1] + } + } unresolvedDisjunction: { #TypePrimitive: { "*": {} @@ -1463,5 +1432,6 @@ Improved error messages. } } } + x: "foo" y: "foo" } diff --git a/internal/core/export/testdata/main/merge.txtar b/internal/core/export/testdata/main/merge.txtar index bbc434ecf..32180b6e2 100644 --- a/internal/core/export/testdata/main/merge.txtar +++ b/internal/core/export/testdata/main/merge.txtar @@ -75,112 +75,6 @@ Reordering. [#B #def] [#B #f] [#B #bar] --- out/value-v3 -- -== Simplified -{} -== Raw -{ - #A: { - _ - #a: string - } - #E: _ - #F: _ - #G: _ - #B: { - 2 - #f: int - #def: 3 - #bar: int - #a: string - } -} -== Final -{} -== All -{ - #A: { - _ - #a: string - } - #E: _ - #F: _ - #G: _ - #B: { - 2 - #f: int - #def: 3 - #bar: int - #a: string - } -} -== Eval -{ - #A: { - _ - #a: string - } - #E: _ - #F: _ - #G: _ - #B: { - 2 - #f: int - #def: 3 - #bar: int - #a: string - } -} --- diff/-out/value-v3<==>+out/value -- -diff old new ---- old -+++ new -@@ -11,10 +11,10 @@ - #G: _ - #B: { - 2 -- #a: string -- #f: int -- #def: 3 -- #bar: int -+ #f: int -+ #def: 3 -+ #bar: int -+ #a: string - } - } - == Final -@@ -30,10 +30,10 @@ - #G: _ - #B: { - 2 -- #a: string -- #f: int -- #def: 3 -- #bar: int -+ #f: int -+ #def: 3 -+ #bar: int -+ #a: string - } - } - == Eval -@@ -47,9 +47,9 @@ - #G: _ - #B: { - 2 -- #a: string -- #f: int -- #def: 3 -- #bar: int -+ #f: int -+ #def: 3 -+ #bar: int -+ #a: string - } - } --- diff/value/todo/p2 -- -Reordering. -- out/value -- == Simplified {} @@ -196,8 +90,8 @@ Reordering. #B: { 2 #a: string - #f: int #def: 3 + #f: int #bar: int } } @@ -215,8 +109,8 @@ Reordering. #B: { 2 #a: string - #f: int #def: 3 + #f: int #bar: int } } @@ -232,8 +126,8 @@ Reordering. #B: { 2 #a: string - #f: int #def: 3 + #f: int #bar: int } } diff --git a/internal/core/export/testdata/main/shadow.txtar b/internal/core/export/testdata/main/shadow.txtar index 00a50b99c..f9ab62905 100644 --- a/internal/core/export/testdata/main/shadow.txtar +++ b/internal/core/export/testdata/main/shadow.txtar @@ -476,8 +476,8 @@ _|_ // shadowRef.e1.x.x: structural cycle b: 0 d: { b: 1 - A: 1 c: 0 + A: 1 } } } @@ -487,8 +487,8 @@ _|_ // shadowRef.e1.x.x: structural cycle b: 0 d: { b: 1 - A: 1 c: 0 + A: 1 } } } @@ -651,8 +651,8 @@ _|_ // shadowRef.e1.x.x: structural cycle (and 1 more errors) b: 0 d: { b: 1 - A: 1 c: 0 + A: 1 } } } @@ -662,8 +662,8 @@ _|_ // shadowRef.e1.x.x: structural cycle (and 1 more errors) b: 0 d: { b: 1 - A: 1 c: 0 + A: 1 } } } diff --git a/internal/core/runtime/testdata/basic.txtar b/internal/core/runtime/testdata/basic.txtar index 5e0dd2ddf..389b9180d 100644 --- a/internal/core/runtime/testdata/basic.txtar +++ b/internal/core/runtime/testdata/basic.txtar @@ -26,8 +26,8 @@ Bar: { -- extern/out -- -- out/extern -- { + Bar: implBar2 Foo: implFoo1 Rename: implEmaner1 - Bar: implBar2 "Quoted-Field": implEmaner1 } diff --git a/internal/core/runtime/testdata/legacy.txtar b/internal/core/runtime/testdata/legacy.txtar index 0bd1a85e3..7a8d74a66 100644 --- a/internal/core/runtime/testdata/legacy.txtar +++ b/internal/core/runtime/testdata/legacy.txtar @@ -24,7 +24,7 @@ Bar: { -- extern/out -- -- out/extern -- { - Foo: implFoo1 Bar: implBar2 + Foo: implFoo1 Rename: implEmaner1 } diff --git a/internal/cueexperiment/exp.go b/internal/cueexperiment/exp.go index ea88f6010..0f7f59154 100644 --- a/internal/cueexperiment/exp.go +++ b/internal/cueexperiment/exp.go @@ -24,7 +24,7 @@ var Flags struct { DecodeInt64 bool `envflag:"default:true"` // Enable topological sorting of struct fields. - TopoSort bool + TopoSort bool `envflag:"default:true"` // The flags below describe completed experiments; they can still be set // as long as the value aligns with the final behavior once the experiment finished. diff --git a/pkg/encoding/json/testdata/gen.txtar b/pkg/encoding/json/testdata/gen.txtar index 303504235..fac2d77b0 100644 --- a/pkg/encoding/json/testdata/gen.txtar +++ b/pkg/encoding/json/testdata/gen.txtar @@ -223,13 +223,13 @@ marshalStream: { } marshal: { t1: { - #x: int #result: json.Marshal(X) + #x: int a: int } t2: { - a: "\\ \" & < >" #result: "{\"a\":\"\\\\ \\\" & < >\"}" + a: "\\ \" & < >" } } htmlEscape: { diff --git a/pkg/list/testdata/unique.txtar b/pkg/list/testdata/unique.txtar index 9e2732cfa..b7a993925 100644 --- a/pkg/list/testdata/unique.txtar +++ b/pkg/list/testdata/unique.txtar @@ -159,6 +159,9 @@ incomplete: { a: 1 }] + // Fully identical closed structs, but with non-concrete values. + structs: list.UniqueItems() & [#c, #c] + // Value could still become more specific, and thus different. ints: list.UniqueItems() & [int, int] @@ -172,9 +175,6 @@ incomplete: { a: 0 b: 1 }] - - // Fully identical closed structs, but with non-concrete values. - structs: list.UniqueItems() & [#c, #c] } fail: { ints: _|_ // fail.ints: invalid value [1,2,1] (does not satisfy list.UniqueItems): equal value (1) at position 0 and 2 @@ -183,14 +183,14 @@ fail: { // Hidden values do not play a role in the comparisson. ignoreHidden: _|_ // fail.ignoreHidden: invalid value [1,1] (does not satisfy list.UniqueItems): equal value (1) at position 0 and 1 + // This can be a permanent error, as the optional field of the second + // element is erroneous an cannot match. + ignoreOptError: _|_ // fail.ignoreOptError: invalid value [~(#a),~(#abErr)] (does not satisfy list.UniqueItems): equal values at position 0 and 1 + // Struct field order is irrelevant. We simulate finalising // these values here via close(), which gives the same behaviour // as 'cue vet -c' on otherwise open values. structOrderIrrelevant: _|_ // fail.structOrderIrrelevant: invalid value [{b:1,a:0},{a:0,b:1}] (does not satisfy list.UniqueItems): equal values at position 0 and 1 - - // This can be a permanent error, as the optional field of the second - // element is erroneous an cannot match. - ignoreOptError: _|_ // fail.ignoreOptError: invalid value [~(#a),~(#abErr)] (does not satisfy list.UniqueItems): equal values at position 0 and 1 } -- diff/-out/list-v3<==>+out/list -- diff old new @@ -238,7 +238,7 @@ diff old new // Hidden values do not play a role in the comparisson. ignoreHidden: _|_ // fail.ignoreHidden: invalid value [1,1] (does not satisfy list.UniqueItems): equal value (1) at position 0 and 1 -@@ -112,10 +110,5 @@ +@@ -107,12 +105,7 @@ // This can be a permanent error, as the optional field of the second // element is erroneous an cannot match. @@ -249,7 +249,9 @@ diff old new - b?: int & string - }] + ignoreOptError: _|_ // fail.ignoreOptError: invalid value [~(#a),~(#abErr)] (does not satisfy list.UniqueItems): equal values at position 0 and 1 - } + + // Struct field order is irrelevant. We simulate finalising + // these values here via close(), which gives the same behaviour -- out/list -- Errors: fail.ignoreHidden: invalid value [1,1] (does not satisfy list.UniqueItems): equal value (1) at position 0 and 1: @@ -334,6 +336,9 @@ incomplete: { a: 1 }] + // Fully identical closed structs, but with non-concrete values. + structs: list.UniqueItems() & [#c, #c] + // Value could still become more specific, and thus different. ints: list.UniqueItems() & [int, int] @@ -347,9 +352,6 @@ incomplete: { a: 0 b: 1 }] - - // Fully identical closed structs, but with non-concrete values. - structs: list.UniqueItems() & [#c, #c] } fail: { ints: _|_ // fail.ints: invalid value [1,2,1] (does not satisfy list.UniqueItems): equal value (1) at position 0 and 2 @@ -358,11 +360,6 @@ fail: { // Hidden values do not play a role in the comparisson. ignoreHidden: _|_ // fail.ignoreHidden: invalid value [1,1] (does not satisfy list.UniqueItems): equal value (1) at position 0 and 1 - // Struct field order is irrelevant. We simulate finalising - // these values here via close(), which gives the same behaviour - // as 'cue vet -c' on otherwise open values. - structOrderIrrelevant: _|_ // fail.structOrderIrrelevant: invalid value [{b:1,a:0},{a:0,b:1}] (does not satisfy list.UniqueItems): equal values at position 0 and 1 - // This can be a permanent error, as the optional field of the second // element is erroneous an cannot match. ignoreOptError: [{ @@ -371,4 +368,9 @@ fail: { a: 1 b?: int & string }] + + // Struct field order is irrelevant. We simulate finalising + // these values here via close(), which gives the same behaviour + // as 'cue vet -c' on otherwise open values. + structOrderIrrelevant: _|_ // fail.structOrderIrrelevant: invalid value [{b:1,a:0},{a:0,b:1}] (does not satisfy list.UniqueItems): equal values at position 0 and 1 } diff --git a/pkg/path/testdata/os.txtar b/pkg/path/testdata/os.txtar index b92f46d90..194300a0b 100644 --- a/pkg/path/testdata/os.txtar +++ b/pkg/path/testdata/os.txtar @@ -155,14 +155,6 @@ Volume: [_]: { #OSes: ["unix", "windows", "plan9"] #AnyOS: "unix" | "windows" | "plan9" Split: { - default: { - "/foo/bar/baz": ["/foo/bar/", "baz"] - "a/b": ["a/", "b"] - "//host/share/foo": ["//host/share/", "foo"] - "\\\\host\\share\\foo": ["", "\\\\host\\share\\foo"] - "c:/foo/bar": ["c:/foo/", "bar"] - "c:\\foo\\bar": ["", "c:\\foo\\bar"] - } unix: { "/foo/bar/baz": ["/foo/bar/", "baz"] "a/b": ["a/", "b"] @@ -187,6 +179,14 @@ Split: { "c:/foo/bar": ["c:/foo/", "bar"] "c:\\foo\\bar": ["c:\\foo\\", "bar"] } + default: { + "/foo/bar/baz": ["/foo/bar/", "baz"] + "a/b": ["a/", "b"] + "//host/share/foo": ["//host/share/", "foo"] + "\\\\host\\share\\foo": ["", "\\\\host\\share\\foo"] + "c:/foo/bar": ["c:/foo/", "bar"] + "c:\\foo\\bar": ["", "c:\\foo\\bar"] + } } SplitList: { unix: { @@ -206,10 +206,6 @@ SplitList: { } } Clean: { - default: { - "abc//def//ghi": "abc/def/ghi" - "c:\\abc\\def\\..\\..": "c:\\abc\\def\\..\\.." - } unix: { "abc//def//ghi": "abc/def/ghi" "c:\\abc\\def\\..\\..": "c:\\abc\\def\\..\\.." @@ -222,9 +218,13 @@ Clean: { "abc//def//ghi": "abc\\def\\ghi" "c:\\abc\\def\\..\\..": "c:\\" } + default: { + "abc//def//ghi": "abc/def/ghi" + "c:\\abc\\def\\..\\..": "c:\\abc\\def\\..\\.." + } } Match: { - default: { + unix: { "*c": { abc: true } @@ -235,7 +235,7 @@ Match: { "c:\\a\\b\\file.zip": true } } - unix: { + plan9: { "*c": { abc: true } @@ -246,26 +246,26 @@ Match: { "c:\\a\\b\\file.zip": true } } - plan9: { + windows: { "*c": { abc: true } "*.txt": { - "a/b.txt": false + "a/b.txt": true } "*.zip": { - "c:\\a\\b\\file.zip": true + "c:\\a\\b\\file.zip": false } } - windows: { + default: { "*c": { abc: true } "*.txt": { - "a/b.txt": true + "a/b.txt": false } "*.zip": { - "c:\\a\\b\\file.zip": false + "c:\\a\\b\\file.zip": true } } } @@ -338,7 +338,7 @@ Slash: { } } Ext: { - default: { + unix: { // Same for all OS-es "path.go": ".go" "path.pb.go": ".go" @@ -349,7 +349,7 @@ Ext: { // Differs on Windows. "a.dir\\foo": ".dir\\foo" } - unix: { + plan9: { // Same for all OS-es "path.go": ".go" "path.pb.go": ".go" @@ -360,7 +360,7 @@ Ext: { // Differs on Windows. "a.dir\\foo": ".dir\\foo" } - plan9: { + windows: { // Same for all OS-es "path.go": ".go" "path.pb.go": ".go" @@ -369,9 +369,9 @@ Ext: { "a.dir/": "" // Differs on Windows. - "a.dir\\foo": ".dir\\foo" + "a.dir\\foo": "" } - windows: { + default: { // Same for all OS-es "path.go": ".go" "path.pb.go": ".go" @@ -380,11 +380,11 @@ Ext: { "a.dir/": "" // Differs on Windows. - "a.dir\\foo": "" + "a.dir\\foo": ".dir\\foo" } } Resolve: { - default: { + unix: { "a/b/c": { "d/e": "a/b/c/d/e" } @@ -399,7 +399,7 @@ Resolve: { "//other/abs/foo": "/other/abs/foo" } } - unix: { + plan9: { "a/b/c": { "d/e": "a/b/c/d/e" } @@ -414,47 +414,38 @@ Resolve: { "//other/abs/foo": "/other/abs/foo" } } - plan9: { + windows: { "a/b/c": { - "d/e": "a/b/c/d/e" + "d/e": "a\\b\\c\\d\\e" } "/a/b": { - "/c/d": "/c/d" + "/c/d": "\\a\\b\\c\\d" } "c:/a": { - "d:\\": "c:/a/d:\\" + "d:\\": "d:\\" } "//home/user/foo": { - bar: "/home/user/foo/bar" - "//other/abs/foo": "/other/abs/foo" + bar: "\\\\home\\user\\foo\\bar" + "//other/abs/foo": "\\\\other\\abs\\foo" } } - windows: { + default: { "a/b/c": { - "d/e": "a\\b\\c\\d\\e" + "d/e": "a/b/c/d/e" } "/a/b": { - "/c/d": "\\a\\b\\c\\d" + "/c/d": "/c/d" } "c:/a": { - "d:\\": "d:\\" + "d:\\": "c:/a/d:\\" } "//home/user/foo": { - bar: "\\\\home\\user\\foo\\bar" - "//other/abs/foo": "\\\\other\\abs\\foo" + "//other/abs/foo": "/other/abs/foo" + bar: "/home/user/foo/bar" } } } IsAbs: { - default: { - "": false - "/a": true - a: false - "c:": false - "c:/": false - "c:\\": false - "//home/user/foo": true - } unix: { "": false "/a": true @@ -482,6 +473,15 @@ IsAbs: { "c:\\": true "//home/user/foo": true } + default: { + "": false + "/a": true + a: false + "c:": false + "c:/": false + "c:\\": false + "//home/user/foo": true + } } Volume: { unix: { diff --git a/pkg/time/testdata/gen.txtar b/pkg/time/testdata/gen.txtar index 0b89a35b6..d7c880207 100644 --- a/pkg/time/testdata/gen.txtar +++ b/pkg/time/testdata/gen.txtar @@ -41,12 +41,12 @@ parse: { } split: { t1: { - year: 2017 - month: 7 day: 14 hour: 2 minute: 40 - second: 0 + month: 7 nanosecond: 123456 + second: 0 + year: 2017 } } diff --git a/tools/flow/testdata/dep.txtar b/tools/flow/testdata/dep.txtar index fdc77dfb7..a98d3a9f2 100644 --- a/tools/flow/testdata/dep.txtar +++ b/tools/flow/testdata/dep.txtar @@ -102,8 +102,8 @@ graph TD -- out/run/t1/value -- { - b: 3 $id: "valToOut" + b: 3 } -- out/run/t1/stats -- Leaks: 0 @@ -137,10 +137,10 @@ graph TD -- out/run/t2/value -- { + $id: "valToOut" x: { foo: 3 } - $id: "valToOut" index: int } -- out/run/t2/stats -- @@ -175,8 +175,8 @@ graph TD -- out/run/t3/value -- { - x: [0, 1][INDEX] $id: "valToOut" + x: [0, 1][INDEX] //cue:path: root.concreteValueInGeneratedSubfield.index let INDEX = int @@ -213,12 +213,12 @@ graph TD -- out/run/t4/value -- { + $id: "valToOut" $after: { - x: [0, 1][INDEX] $id: "valToOut" + x: [0, 1][INDEX] } - $id: "valToOut" - x: 3 + x: 3 //cue:path: root.concreteValueInGeneratedSubfield.index let INDEX = int @@ -255,8 +255,8 @@ graph TD -- out/run/t5/value -- { - x: 3 $id: "valToOut" + x: 3 } -- out/run/t5/stats -- Leaks: 0 @@ -290,11 +290,11 @@ graph TD -- out/run/t6/value -- { + $id: "valToOut" x: { - x: 3 $id: "valToOut" + x: 3 } - $id: "valToOut" incomplete: _ } -- out/run/t6/stats -- @@ -329,10 +329,10 @@ graph TD -- out/run/t7/value -- { + $id: "valToOut" x: { for x in INCOMPLETE {} } - $id: "valToOut" //cue:path: root.indirectTaskRootReference.incomplete let INCOMPLETE = _ @@ -369,8 +369,8 @@ graph TD -- out/run/t8/value -- { - x: [X] $id: "valToOut" + x: [X] //cue:path: root.incompleteComprehensionSource.x let X = { @@ -412,10 +412,10 @@ graph TD -- out/run/t9/value -- { + $id: "valToOut" x: { foo: [X_1] } - $id: "valToOut" //cue:path: root.incompleteComprehensionSource.x let X_1 = { diff --git a/tools/flow/testdata/dynamic.txtar b/tools/flow/testdata/dynamic.txtar index e9c4aa57e..0d1b5229b 100644 --- a/tools/flow/testdata/dynamic.txtar +++ b/tools/flow/testdata/dynamic.txtar @@ -61,8 +61,8 @@ graph TD -- out/run/t2/value -- { $id: "sequenced" - seq: 2 out: "foo2" + seq: 2 val: "foo2" } -- out/run/t3 -- @@ -81,8 +81,8 @@ graph TD $id: "list" $after: [{ $id: "sequenced" - seq: 2 out: "foo2" + seq: 2 val: "foo2" }] out: [1, 2] diff --git a/tools/flow/testdata/issue2416a.txtar b/tools/flow/testdata/issue2416a.txtar index 17fed83f2..f316d57c6 100644 --- a/tools/flow/testdata/issue2416a.txtar +++ b/tools/flow/testdata/issue2416a.txtar @@ -74,47 +74,9 @@ graph TD $id: "tool/file.Mkdir" path: "output" createParents: true - stdout: "foo" permissions: 511 + stdout: "foo" } --- out/run-v3/t2/value -- -{ - $after: { - $id: "tool/file.Mkdir" - path: "output" - createParents: true - stdout: "foo" - permissions: 511 - } - $id: "tool/file.Create" - filename: "output/dns-records.zone" - permissions: 438 - contents: """ - kube-vagrant-monitoring-proxy A 127.0.0.1 - - """ - stdout: "foo" -} --- diff/-out/run-v3/t2/value<==>+out/run/t2/value -- -diff old new ---- old -+++ new -@@ -1,5 +1,4 @@ - { -- $id: "tool/file.Create" - $after: { - $id: "tool/file.Mkdir" - path: "output" -@@ -7,6 +6,7 @@ - stdout: "foo" - permissions: 511 - } -+ $id: "tool/file.Create" - filename: "output/dns-records.zone" - permissions: 438 - contents: """ --- diff/value/todo/p3 -- -Reordering. -- out/run/t1/stats -- Leaks: 0 Freed: 56 @@ -133,14 +95,14 @@ graph TD -- out/run/t2/value -- { - $id: "tool/file.Create" $after: { $id: "tool/file.Mkdir" path: "output" createParents: true - stdout: "foo" permissions: 511 + stdout: "foo" } + $id: "tool/file.Create" filename: "output/dns-records.zone" permissions: 438 contents: """ diff --git a/tools/flow/testdata/issue2490.txtar b/tools/flow/testdata/issue2490.txtar index dc0f40a32..7c767baa9 100644 --- a/tools/flow/testdata/issue2490.txtar +++ b/tools/flow/testdata/issue2490.txtar @@ -23,6 +23,23 @@ graph TD graph TD t0("root.foo [Terminated]") +-- out/run-v3/t1/value -- +{ + $id: "tool/cli.Print" + text: "{}" + stdout: "foo" +} +-- diff/-out/run-v3/t1/value<==>+out/run/t1/value -- +diff old new +--- old ++++ new +@@ -1,5 +1,5 @@ + { + $id: "tool/cli.Print" +- stdout: "foo" + text: "{}" ++ stdout: "foo" + } -- out/run/t1/value -- { $id: "tool/cli.Print" diff --git a/tools/flow/testdata/issue2517.txtar b/tools/flow/testdata/issue2517.txtar index 56caaf324..6a5b840dc 100644 --- a/tools/flow/testdata/issue2517.txtar +++ b/tools/flow/testdata/issue2517.txtar @@ -52,11 +52,11 @@ graph TD -- out/run/t2/value -- { - $id: "run" - stdout: "foo" + $id: "run" env: { input: "foo" } + stdout: "foo" } -- out/run/t2/stats -- Leaks: 0 diff --git a/tools/flow/testdata/issue2965.txtar b/tools/flow/testdata/issue2965.txtar index e66c64468..4e8d438bb 100644 --- a/tools/flow/testdata/issue2965.txtar +++ b/tools/flow/testdata/issue2965.txtar @@ -55,11 +55,11 @@ graph TD -- out/run/t2/value -- { - $id: "run" - stdout: "foo" + $id: "run" env: { input: "foo" } + stdout: "foo" } -- out/run/t2/stats -- Leaks: 0 diff --git a/tools/flow/testdata/slice.txtar b/tools/flow/testdata/slice.txtar index b92518775..5ac2035cb 100644 --- a/tools/flow/testdata/slice.txtar +++ b/tools/flow/testdata/slice.txtar @@ -24,21 +24,21 @@ root: [ -- out/run/errors -- -- out/run/t0 -- graph TD - t0("root[0] [Ready]") + t0("root[2] [Waiting]") + t0-->t2 + t0-->t1 t1("root[1] [Waiting]") - t1-->t0 - t2("root[2] [Waiting]") - t2-->t0 - t2-->t1 + t1-->t2 + t2("root[0] [Ready]") -- out/run/t1 -- graph TD - t0("root[0] [Terminated]") + t0("root[2] [Waiting]") + t0-->t2 + t0-->t1 t1("root[1] [Ready]") - t1-->t0 - t2("root[2] [Waiting]") - t2-->t0 - t2-->t1 + t1-->t2 + t2("root[0] [Terminated]") -- out/run/t1/value -- { @@ -58,12 +58,12 @@ Conjuncts: 30 Disjuncts: 17 -- out/run/t2 -- graph TD - t0("root[0] [Terminated]") + t0("root[2] [Ready]") + t0-->t2 + t0-->t1 t1("root[1] [Terminated]") - t1-->t0 - t2("root[2] [Ready]") - t2-->t0 - t2-->t1 + t1-->t2 + t2("root[0] [Terminated]") -- out/run/t2/value -- { @@ -88,12 +88,12 @@ Conjuncts: 33 Disjuncts: 17 -- out/run/t3 -- graph TD - t0("root[0] [Terminated]") + t0("root[2] [Terminated]") + t0-->t2 + t0-->t1 t1("root[1] [Terminated]") - t1-->t0 - t2("root[2] [Terminated]") - t2-->t0 - t2-->t1 + t1-->t2 + t2("root[0] [Terminated]") -- out/run/t3/value -- { diff --git a/tools/flow/testdata/template.txtar b/tools/flow/testdata/template.txtar index 6794a403f..f3b2928d8 100644 --- a/tools/flow/testdata/template.txtar +++ b/tools/flow/testdata/template.txtar @@ -36,86 +36,15 @@ graph TD t1("root.convert [Ready]") t1-->t0 --- out/run-v3/t1/value -- -{ - $id: "tool/http.Do" - method: "GET" - stdout: "foo" - request: { - body: "" - } - url: "https://raw.githubusercontent.com/SchemaStore/schemastore/f7a0789ccb3bd74a720ddbd6691d60fd9e2d8b7a/src/schemas/json/github-workflow.json" -} --- out/run-v3/t2/value -- -{ - $id: "tool/exec.Run" - stdin: GET.response.body & (*null | string | bytes) - cmd: "go run cuelang.org/go/cmd/cue import -f -p json -l #Workflow: jsonschema: - --outfile pkg/github.com/SchemaStore/schemastore/src/schemas/json/github-workflow.cue" - env: {} | [] - stdout: "foo" - stderr: null - success: bool - mustSucceed: true - - //cue:path: root.get - let GET = { - $id: "tool/http.Do" - method: "GET" - url: string - request: { - body: *bytes | string - } - } & { - request: { - body: "" - } - stdout: "foo" - url: "https://raw.githubusercontent.com/SchemaStore/schemastore/f7a0789ccb3bd74a720ddbd6691d60fd9e2d8b7a/src/schemas/json/github-workflow.json" - } -} --- diff/-out/run-v3/t1/value<==>+out/run/t1/value -- -diff old new ---- old -+++ new -@@ -2,8 +2,8 @@ - $id: "tool/http.Do" - method: "GET" - stdout: "foo" -- url: "https://raw.githubusercontent.com/SchemaStore/schemastore/f7a0789ccb3bd74a720ddbd6691d60fd9e2d8b7a/src/schemas/json/github-workflow.json" - request: { - body: "" - } -+ url: "https://raw.githubusercontent.com/SchemaStore/schemastore/f7a0789ccb3bd74a720ddbd6691d60fd9e2d8b7a/src/schemas/json/github-workflow.json" - } --- diff/-out/run-v3/t2/value<==>+out/run/t2/value -- -diff old new ---- old -+++ new -@@ -1,10 +1,10 @@ - { -- $id: "tool/exec.Run" -- cmd: "go run cuelang.org/go/cmd/cue import -f -p json -l #Workflow: jsonschema: - --outfile pkg/github.com/SchemaStore/schemastore/src/schemas/json/github-workflow.cue" -+ $id: "tool/exec.Run" -+ stdin: GET.response.body & (*null | string | bytes) -+ cmd: "go run cuelang.org/go/cmd/cue import -f -p json -l #Workflow: jsonschema: - --outfile pkg/github.com/SchemaStore/schemastore/src/schemas/json/github-workflow.cue" - env: {} | [] - stdout: "foo" - stderr: null -- stdin: GET.response.body & (*null | string | bytes) - success: bool - mustSucceed: true - --- diff/value/p3 -- -Reordering. -- out/run/t1/value -- { $id: "tool/http.Do" method: "GET" - stdout: "foo" url: "https://raw.githubusercontent.com/SchemaStore/schemastore/f7a0789ccb3bd74a720ddbd6691d60fd9e2d8b7a/src/schemas/json/github-workflow.json" request: { body: "" } + stdout: "foo" } -- out/run/t1/stats -- Leaks: 0 -- 2.51.2