File tree Expand file tree Collapse file tree 2 files changed +5
-42
lines changed
tests/test-sources/plugins/lazyloading Expand file tree Collapse file tree 2 files changed +5
-42
lines changed Original file line number Diff line number Diff line change 201201 name = originalName ;
202202 main = luaName ;
203203 pkg = cfg . package ;
204- # Use provided config, otherwise fallback to normal lua content
205- config =
206- cfg . lazyLoad . settings . config or
207- # We need to wrap it in a function so it doesn't execute immediately
208- ( "function()\n " + cfg . luaConfig . content + " \n end" ) ;
204+ # Use provided opts, otherwise fallback to settings
205+ opts = cfg . lazyLoad . settings . opts or cfg . settings ;
209206 }
210207 // ( lib . removeAttrs cfg . lazyLoad . settings [
211- "config "
208+ "opts "
212209 ] )
213210 )
214211 ] ;
Original file line number Diff line number Diff line change 3939 plugins = config . plugins . lazy . plugins or [ ] ;
4040 plugin = if builtins . length plugins > 0 then builtins . head plugins else null ;
4141 in
42- plugin != null && lib . hasInfix config . plugins . neotest . luaConfig . content plugin . config . __raw ;
43- message = "`lazy.plugins[0].after ` should have contained `neotest` lua content ." ;
42+ plugin != null && config . plugins . neotest . settings == plugin . opts ;
43+ message = "`lazy.plugins[0].opts ` should have contained `neotest` settings ." ;
4444 }
4545 ] ;
4646 } ;
102102 }
103103 ] ;
104104 } ;
105- wrap-functionless-luaConfig =
106- { config , ... } :
107- {
108- plugins = {
109- lazy = {
110- enable = true ;
111- } ;
112- web-devicons . enable = false ;
113- telescope = {
114- enable = true ;
115- lazyLoad = {
116- enable = true ;
117- settings = {
118- cmd = [ "Telescope" ] ;
119- } ;
120- } ;
121- } ;
122- } ;
123-
124- assertions = [
125- {
126- assertion = ( builtins . length config . plugins . lazy . plugins ) == 1 ;
127- message = "`lazy.plugins` should have contained a single plugin configuration, but contained ${ builtins . toJSON config . plugins . lz-n . plugins } " ;
128- }
129- {
130- assertion =
131- let
132- plugin = builtins . head config . plugins . lazy . plugins ;
133- in
134- plugin . config . __raw == "function()\n " + config . plugins . telescope . luaConfig . content + " \n end" ;
135- message = "`lazy.plugins[0].config` should have contained a function wrapped `telescope` lua content." ;
136- }
137- ] ;
138- } ;
139105}
You can’t perform that action at this time.
0 commit comments