|
| 1 | +let |
| 2 | +getFirstLznPlugin= |
| 3 | +config: |
| 4 | +let |
| 5 | +inherit(config.plugins.lazy)plugins; |
| 6 | +in |
| 7 | +ifplugins==[]thennullelsebuiltins.headplugins; |
| 8 | + |
| 9 | +getPluginKeys=plugin:ifplugin!=null&&builtins.isListplugin.keysthenplugin.keyselse[]; |
| 10 | +getPluginCmd=plugin:ifplugin!=null&&builtins.isListplugin.cmdthenplugin.cmdelse[]; |
| 11 | +in |
1 | 12 | { |
2 | 13 | lazy-load-neovim-plugin-configured= |
3 | 14 | {config,lib, ...}: |
|
18 | 29 | }; |
19 | 30 | }; |
20 | 31 |
|
21 | | -assertions=[ |
22 | | -{ |
23 | | -assertion=(builtins.lengthconfig.plugins.lazy.plugins)==1; |
24 | | -message="`lazy.plugins` should have contained a single plugin configuration, but contained${builtins.toJSONconfig.plugins.lz-n.plugins}"; |
25 | | -} |
26 | | -{ |
27 | | -assertion= |
28 | | -let |
29 | | -plugins=config.plugins.lazy.pluginsor[]; |
30 | | -plugin=ifbuiltins.lengthplugins>0thenbuiltins.headpluginselsenull; |
31 | | -cmd=ifplugin!=null&&builtins.isListplugin.cmdthenplugin.cmdelse[]; |
32 | | -in |
33 | | -(builtins.lengthcmd)==1; |
34 | | -message="`lazy.plugins[0].cmd` should have contained a configuration."; |
35 | | -} |
36 | | -{ |
37 | | -assertion= |
38 | | -let |
39 | | -plugins=config.plugins.lazy.pluginsor[]; |
40 | | -plugin=ifbuiltins.lengthplugins>0thenbuiltins.headpluginselsenull; |
41 | | -in |
42 | | -plugin!=null&&config.plugins.neotest.settings==plugin.opts; |
43 | | -message="`lazy.plugins[0].opts` should have contained `neotest` settings."; |
44 | | -} |
45 | | -]; |
| 32 | +assertions= |
| 33 | +let |
| 34 | +plugin=getFirstLznPluginconfig; |
| 35 | +cmd=getPluginCmdplugin; |
| 36 | +in |
| 37 | +[ |
| 38 | +{ |
| 39 | +assertion=(builtins.lengthconfig.plugins.lazy.plugins)==1; |
| 40 | +message="`lazy.plugins` should have contained a single plugin configuration, but contained${builtins.toJSONconfig.plugins.lz-n.plugins}"; |
| 41 | +} |
| 42 | +{ |
| 43 | +assertion=(builtins.lengthcmd)==1; |
| 44 | +message="`lazy.plugins[0].cmd` should have contained a configuration."; |
| 45 | +} |
| 46 | +{ |
| 47 | +assertion=plugin!=null&&config.plugins.neotest.settings==plugin.opts; |
| 48 | +message="`lazy.plugins[0].opts` should have contained `neotest` settings."; |
| 49 | +} |
| 50 | +]; |
46 | 51 | }; |
47 | 52 |
|
48 | 53 | dont-lazy-load-unconfigured= |
|
85 | 90 | }; |
86 | 91 | }; |
87 | 92 |
|
88 | | -assertions=[ |
89 | | -{ |
90 | | -assertion=(builtins.lengthconfig.plugins.lazy.plugins)==1; |
91 | | -message="`lazy.plugins` should have contained a single plugin configuration, but contained${builtins.toJSONconfig.plugins.lz-n.plugins}"; |
92 | | -} |
93 | | -{ |
94 | | -assertion= |
95 | | -let |
96 | | -plugins=config.plugins.lazy.pluginsor[]; |
97 | | -plugin=ifbuiltins.lengthplugins>0thenbuiltins.headpluginselsenull; |
98 | | -cmd=ifplugin!=null&&builtins.isListplugin.cmdthenplugin.cmdelse[]; |
99 | | -in |
100 | | -(builtins.lengthcmd)==1; |
101 | | -message="`lazy.plugins[0].cmd` should have contained a configuration."; |
102 | | -} |
103 | | -]; |
| 93 | +assertions= |
| 94 | +let |
| 95 | +plugin=getFirstLznPluginconfig; |
| 96 | +cmd=getPluginCmdplugin; |
| 97 | +in |
| 98 | +[ |
| 99 | +{ |
| 100 | +assertion=(builtins.lengthconfig.plugins.lazy.plugins)==1; |
| 101 | +message="`lazy.plugins` should have contained a single plugin configuration, but contained${builtins.toJSONconfig.plugins.lz-n.plugins}"; |
| 102 | +} |
| 103 | +{ |
| 104 | +assertion=(builtins.lengthcmd)==1; |
| 105 | +message="`lazy.plugins[0].cmd` should have contained a configuration."; |
| 106 | +} |
| 107 | +]; |
104 | 108 | }; |
105 | 109 | } |