feat: qol improvements

This commit is contained in:
Barrett Ruth 2025-09-18 21:28:34 -04:00
parent 986e03c974
commit 5bf8c8960b
13 changed files with 810 additions and 0 deletions

81
tests/problem_spec.lua Normal file
View file

@ -0,0 +1,81 @@
-- Unit tests for problem context and file management
describe("cp.problem", function()
local problem
local temp_dir
before_each(function()
problem = require("cp.problem")
temp_dir = vim.fn.tempname()
vim.fn.mkdir(temp_dir, "p")
-- Change to temp directory for testing
vim.api.nvim_set_current_dir(temp_dir)
end)
after_each(function()
vim.fn.delete(temp_dir, "rf")
end)
describe("context creation", function()
it("creates context for Codeforces problems", function()
-- Test context creation with proper paths
end)
it("creates context for CSES problems", function()
-- Test CSES-specific context
end)
it("generates correct file paths", function()
-- Test source file path generation
end)
it("generates correct build paths", function()
-- Test build directory structure
end)
end)
describe("template handling", function()
it("applies language templates correctly", function()
-- Test template application
end)
it("handles custom templates", function()
-- Test user-defined templates
end)
it("supports snippet integration", function()
-- Test LuaSnip integration
end)
end)
describe("file operations", function()
it("creates directory structure", function()
-- Test directory creation (build/, io/)
end)
it("handles existing files gracefully", function()
-- Test behavior when files exist
end)
it("sets up input/output files", function()
-- Test I/O file creation
end)
end)
describe("language support", function()
it("supports C++ compilation", function()
-- Test C++ setup and compilation
end)
it("supports Python execution", function()
-- Test Python setup
end)
it("supports Rust compilation", function()
-- Test Rust setup
end)
it("supports custom language configurations", function()
-- Test user-defined language support
end)
end)
end)