mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-05 23:04:31 +02:00
tests: Implement a way to test nixvim (#199)
The tests can be executed using `nix flake check`, they check that modules can be built, and they execute in neovim without any errors. This commit only implements tests for tokyonight-nvim upstream defaults
This commit is contained in:
parent
92867386c7
commit
abc2d19a06
4 changed files with 94 additions and 0 deletions
23
tests/plugins/default.nix
Normal file
23
tests/plugins/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{lib}: let
|
||||
# List of files containing configurations
|
||||
pluginFiles =
|
||||
builtins.filter (p: p != "default.nix") (builtins.attrNames (builtins.readDir ./.));
|
||||
|
||||
/*
|
||||
Create a list of tests. The list is of the form:
|
||||
[ { name = "<plugin>-<test_name>"; value = { ... }; } ]
|
||||
*/
|
||||
makePluginTests = pluginFile: let
|
||||
pluginName = builtins.head (lib.strings.splitString "." pluginFile);
|
||||
pluginConfigs = import (./. + "/${pluginFile}");
|
||||
in
|
||||
lib.attrsets.mapAttrsToList (testName: testConfig: {
|
||||
name = "${pluginName}-${testName}";
|
||||
value = testConfig;
|
||||
})
|
||||
pluginConfigs;
|
||||
|
||||
# A list of lists of test cases for each plugin
|
||||
pluginTests = builtins.map makePluginTests pluginFiles;
|
||||
in
|
||||
builtins.listToAttrs (lib.lists.flatten pluginTests)
|
Loading…
Add table
Add a link
Reference in a new issue