diff options
| author | William Boman <william@redwill.se> | 2023-11-09 00:01:46 +0100 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-02-19 12:15:49 +0100 |
| commit | 7dd3f5fb20e50a9746a648ec9f26ab90f3864c0d (patch) | |
| tree | 29d2256c6f8fb200c2f07fc8cfba6f02b0c8cec0 /tests | |
| parent | refactor!: change Package API (diff) | |
| download | mason-7dd3f5fb20e50a9746a648ec9f26ab90f3864c0d.tar mason-7dd3f5fb20e50a9746a648ec9f26ab90f3864c0d.tar.gz mason-7dd3f5fb20e50a9746a648ec9f26ab90f3864c0d.tar.bz2 mason-7dd3f5fb20e50a9746a648ec9f26ab90f3864c0d.tar.lz mason-7dd3f5fb20e50a9746a648ec9f26ab90f3864c0d.tar.xz mason-7dd3f5fb20e50a9746a648ec9f26ab90f3864c0d.tar.zst mason-7dd3f5fb20e50a9746a648ec9f26ab90f3864c0d.zip | |
fix(expr): also interpolate table keys
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/mason-core/installer/compiler/expr_spec.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/mason-core/installer/compiler/expr_spec.lua b/tests/mason-core/installer/compiler/expr_spec.lua index 944a5983..4f96c04f 100644 --- a/tests/mason-core/installer/compiler/expr_spec.lua +++ b/tests/mason-core/installer/compiler/expr_spec.lua @@ -270,4 +270,17 @@ describe("table interpolation", function() }, {}) ) end) + + it("should interpolate string keys", function() + assert.same( + Result.success { + ["a-1.2.3"] = "1.2.3", + [12] = "12", + }, + expr.tbl_interpolate({ + ["a-{{version}}"] = "{{version}}", + [12] = "12", + }, { version = "1.2.3" }) + ) + end) end) |
