diff options
| author | William Boman <william@redwill.se> | 2025-05-06 02:57:26 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-05-06 02:57:26 +0200 |
| commit | f74983e782b7394f5737df99f8823e196a23291d (patch) | |
| tree | 15ee15a22ad4e8dff13c050a361c99f08d831212 /tests | |
| parent | refactor(registry): change lua registries to not instantiate Package themselves (diff) | |
| download | mason-f74983e782b7394f5737df99f8823e196a23291d.tar mason-f74983e782b7394f5737df99f8823e196a23291d.tar.gz mason-f74983e782b7394f5737df99f8823e196a23291d.tar.bz2 mason-f74983e782b7394f5737df99f8823e196a23291d.tar.lz mason-f74983e782b7394f5737df99f8823e196a23291d.tar.xz mason-f74983e782b7394f5737df99f8823e196a23291d.tar.zst mason-f74983e782b7394f5737df99f8823e196a23291d.zip | |
feat: associate package instances with registry source and record it in receipt
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/fixtures/receipts/2.0.json | 10 | ||||
| -rw-r--r-- | tests/mason-core/installer/InstallRunner_spec.lua | 5 | ||||
| -rw-r--r-- | tests/mason-core/receipt_spec.lua | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/fixtures/receipts/2.0.json b/tests/fixtures/receipts/2.0.json index b0c9e2f1..12e9808d 100644 --- a/tests/fixtures/receipts/2.0.json +++ b/tests/fixtures/receipts/2.0.json @@ -26,5 +26,15 @@ "debug": false, "strict": false, "force": false + }, + "registry": { + "name": "mason-registry", + "version": "2025-05-03-lawful-clave", + "checksums": { + "registry.json": "4ae083fe8e50d0bea5382be05c7ede8d2def55ff2b6b89dc129b153039d9f2a2", + "registry.json.zip": "2116d5db7676afe7052de329db4dfbf656054d8c35ce12414eb9d58561b2fde9" + }, + "proto": "github", + "namespace": "mason-org" } } diff --git a/tests/mason-core/installer/InstallRunner_spec.lua b/tests/mason-core/installer/InstallRunner_spec.lua index 0ff7a40f..48abb77a 100644 --- a/tests/mason-core/installer/InstallRunner_spec.lua +++ b/tests/mason-core/installer/InstallRunner_spec.lua @@ -268,6 +268,7 @@ describe("InstallRunner ::", function() test_helpers.sync_runner_execute(runner, {}) local receipt_file = location:package "dummy/mason-receipt.json" + assert.is_true(fs.sync.file_exists(receipt_file)) assert.is_true(match.tbl_containing { name = "dummy", @@ -277,6 +278,10 @@ describe("InstallRunner ::", function() completion_time = match.is_number(), start_time = match.is_number(), }, + registry = match.same { + proto = "lua", + mod = "dummy-registry.index", + }, source = match.same { id = "pkg:mason/dummy@1.0.0", type = "registry+v1", diff --git a/tests/mason-core/receipt_spec.lua b/tests/mason-core/receipt_spec.lua index 4436233b..1acdfba3 100644 --- a/tests/mason-core/receipt_spec.lua +++ b/tests/mason-core/receipt_spec.lua @@ -67,6 +67,16 @@ describe("receipt ::", function() opt = {}, share = {}, }, receipt:get_links()) + assert.same({ + name = "mason-registry", + version = "2025-05-03-lawful-clave", + checksums = { + ["registry.json"] = "4ae083fe8e50d0bea5382be05c7ede8d2def55ff2b6b89dc129b153039d9f2a2", + ["registry.json.zip"] = "2116d5db7676afe7052de329db4dfbf656054d8c35ce12414eb9d58561b2fde9", + }, + proto = "github", + namespace = "mason-org", + }, receipt:get_registry()) assert.is_true(receipt:is_schema_min "2.0") end) |
