test: expand coverage with DSL edge cases, Lua syntax validation, and module smoke tests - #12
Merged
Merged
Conversation
… module smoke tests
Adds three layers of testing beyond the existing 4 unit tests:
1. DSL Unit Tests (28 new)
- Edge cases for flatten: empty, deeply nested, null
- Edge cases for nix2lua: empty attrs/list, bools, floats, nested
- Edge cases for rawLua, toTable, callWith, attrs2Lua
2. Lua Syntax Validation (9 new)
- Generated Lua is checked with lua's loadfile() to ensure
it parses as valid Lua. Tests cover: minimal config,
settings, mappings, custom lua, vimscript, setup, functions,
and a combined full config.
3. Module Smoke Tests (10 new)
- Each module (essentials, git, nvim-tree, telescope, which-key,
treesitter, lsp, nvchad, rust, ai) is imported and its
generated Lua validated for syntax.
- Combined test imports non-conflicting modules together.
Also adds CI pipeline via GitHub Actions:
- Runs nix flake check on push/PR to master
mdDoc was removed from nixpkgs. In recent nixpkgs, markdown is the default format for option descriptions, so the wrapper is no longer needed and causes eval errors.
nodePackages was removed in nixpkgs; typescript-language-server is now at pkgs.typescript-language-server and vscode-json-languageserver is now vscode-langservers-extracted with the renamed binary vscode-json-language-server. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nvim-treesitter removed the configs submodule in v1; update setup call
from nvim-treesitter.configs to nvim-treesitter. nvim-lspconfig deprecated
require('lspconfig').X.setup() in favour of vim.lsp.config/vim.lsp.enable
introduced in neovim 0.11.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
system_open, open_on_tab, update_cwd (top-level and nested) were dropped in a recent nvim-tree.lua release. Also remove the nested update_cwd from update_focused_file which was removed at the same time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both servers were attaching to any TypeScript file, causing them to fight over the buffer and freeze nvim. ts_ls now only activates in Node projects (package.json/tsconfig.json) and denols in Deno projects (deno.json). Also remove the stale enable=true field from denols that leaked into the server config with the new vim.lsp.config API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without this, denols falls back to the file's directory when no deno.json is found, attaching to any TypeScript file outside a Deno project. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Re-enable single_file_support on denols so it attaches when no deno.json is found, providing LSP coverage for files outside any project. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add statix.toml disabling W20 (repeated keys are intentional in the DSL) - Auto-fix W04/W08/W11/W12 warnings via `statix fix` - Add `statix check` step to CI workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Reformat all .nix files with nixfmt (RFC-style) - Add nixfmt and statix checks to nix flake check - Simplify CI to just nix flake check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Triples the test surface from 4 checks to 47 total, adding three new layers of testing on top of the existing DSL unit tests, plus a CI pipeline.
Changes
Layer 1: DSL Unit Tests (28 new)
Layer 2: Lua Syntax Validation (9 new)
Generated Lua is parsed with
lua -e "assert(loadfile(...))"to guarantee it is syntactically valid Lua, not just correctly structured Nix. Tests cover:Layer 3: Module Smoke Tests (10 new)
Each module is imported into evalModules and its generated Lua is validated for syntax:
CI Pipeline
GitHub Actions workflow that runs
nix flake checkon push/PR to master, using DeterminateSystems nix-installer + magic-nix-cache.How it works
lua -e "assert(loadfile(...))"in a derivation — fails if the Lua has syntax errorsRunning locally
nix flake check