From 2d3432335cc1f4f1d9c4a3c2a0d28b9d33a81609 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 23 Sep 2025 15:37:18 -0400 Subject: [PATCH] fix --- spec/command_parsing_spec.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/command_parsing_spec.lua b/spec/command_parsing_spec.lua index 1c9264e..775b5dc 100644 --- a/spec/command_parsing_spec.lua +++ b/spec/command_parsing_spec.lua @@ -78,7 +78,13 @@ describe('cp command parsing', function() handle_cache_command = function(cmd) if cmd.subcommand == 'clear' then if cmd.platform then - logged_messages[#logged_messages + 1] = { msg = 'cleared cache for ' .. cmd.platform } + local constants = require('cp.constants') + if vim.tbl_contains(constants.PLATFORMS, cmd.platform) then + logged_messages[#logged_messages + 1] = { msg = 'cleared cache for ' .. cmd.platform } + else + logged_messages[#logged_messages + 1] = + { msg = 'unknown platform: ' .. cmd.platform, level = vim.log.levels.ERROR } + end else logged_messages[#logged_messages + 1] = { msg = 'cleared all cache' } end