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 201
201
name = originalName ;
202
202
main = luaName ;
203
203
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 ;
209
206
}
210
207
// ( lib . removeAttrs cfg . lazyLoad . settings [
211
- "config "
208
+ "opts "
212
209
] )
213
210
)
214
211
] ;
Original file line number Diff line number Diff line change 39
39
plugins = config . plugins . lazy . plugins or [ ] ;
40
40
plugin = if builtins . length plugins > 0 then builtins . head plugins else null ;
41
41
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 ." ;
44
44
}
45
45
] ;
46
46
} ;
102
102
}
103
103
] ;
104
104
} ;
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
- } ;
139
105
}
You can’t perform that action at this time.
0 commit comments