From c88d6a4a5bbad984e14c1a2866a15d507a9d0d5e Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 21 Sep 2025 15:24:56 -0400 Subject: [PATCH] feat(test): test new auto-completion logic --- spec/command_parsing_spec.lua | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/spec/command_parsing_spec.lua b/spec/command_parsing_spec.lua index 88c1b7f..3e3691b 100644 --- a/spec/command_parsing_spec.lua +++ b/spec/command_parsing_spec.lua @@ -385,7 +385,6 @@ describe('cp command parsing', function() local complete_fn before_each(function() - -- Mock the command completion function complete_fn = function(ArgLead, CmdLine, _) local constants = require('cp.constants') local platforms = constants.PLATFORMS @@ -448,14 +447,12 @@ describe('cp command parsing', function() return {} end - -- Mock cp module package.loaded['cp'] = { get_current_context = function() return { platform = nil, contest_id = nil } end, } - -- Mock cache module package.loaded['cp.cache'] = { load = function() end, get_contest_data = function() @@ -469,14 +466,11 @@ describe('cp command parsing', function() assert.is_table(result) - -- Should include platforms local has_atcoder = false local has_codeforces = false local has_cses = false - -- Should include global actions local has_cache = false local has_pick = false - -- Should NOT include context-dependent actions local has_run = false local has_next = false local has_prev = false @@ -519,7 +513,6 @@ describe('cp command parsing', function() end) it('completes all actions and problems when contest context exists', function() - -- Mock with contest context package.loaded['cp'] = { get_current_context = function() return { platform = 'atcoder', contest_id = 'abc350' } @@ -547,14 +540,12 @@ describe('cp command parsing', function() items[item] = true end - -- Should include all actions assert.is_true(items['run']) assert.is_true(items['next']) assert.is_true(items['prev']) assert.is_true(items['pick']) assert.is_true(items['cache']) - -- Should include problems assert.is_true(items['a']) assert.is_true(items['b']) assert.is_true(items['c']) @@ -613,7 +604,6 @@ describe('cp command parsing', function() end) it('handles problem completion for platform contest', function() - -- Mock cache with contest problems package.loaded['cp.cache'] = { load = function() end, get_contest_data = function(platform, contest)