diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/mason-registry/sources/collection_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/mason-registry/sources/collection_spec.lua b/tests/mason-registry/sources/collection_spec.lua index b603c868..a5253ab5 100644 --- a/tests/mason-registry/sources/collection_spec.lua +++ b/tests/mason-registry/sources/collection_spec.lua @@ -1,4 +1,5 @@ local LazySourceCollection = require "mason-registry.sources" +local SynthesizedSource = require "mason-registry.sources.synthesized" describe("LazySourceCollection", function() it("should dedupe registries on append/prepend", function() @@ -18,4 +19,22 @@ describe("LazySourceCollection", function() assert.same("github:mason-org/mason-registry@2025-05-16", coll:get(3):get_full_id()) assert.same("file:~/registry", coll:get(4):get_full_id()) end) + + it("should fall back to synthesized source", function() + local coll = LazySourceCollection:new() + + for source in coll:iterate() do + assert.is_true(getmetatable(source) == SynthesizedSource) + return + end + error "Did not fall back to synthesized source" + end) + + it("should exclude synthesized source", function() + local coll = LazySourceCollection:new() + + for source in coll:iterate { include_synthesized = false } do + error "Should not iterate." + end + end) end) |
