feat: base testing files
This commit is contained in:
parent
2704fe6d72
commit
78071b119b
11 changed files with 801 additions and 4 deletions
81
problem_spec.lua
Normal file
81
problem_spec.lua
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue