File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 145
145
expected = [ ./tree/modules/hello-option/mod.nix ] ;
146
146
} ;
147
147
148
+ addAPI . "test API extensions are late bound" = {
149
+ expr =
150
+ let
151
+ first = lit . addAPI { res = self : self . late ; } ;
152
+ extended = first . addAPI { late = _self : "hello" ; } ;
153
+ in
154
+ extended . res ;
155
+ expected = "hello" ;
156
+ } ;
157
+
148
158
pipeTo . "test pipes list into a function" = {
149
159
expr = ( lit . map lib . pathType ) . pipeTo ( lib . length ) ./tree/x ;
150
160
expected = 1 ;
Original file line number Diff line number Diff line change 88
88
self : f :
89
89
let
90
90
__config = ( f self ) ;
91
+ boundAPI = builtins . mapAttrs ( _ : g : g ( self f ) ) __config . api ;
91
92
in
92
- __config . api
93
+ boundAPI
93
94
// {
94
95
inherit __config ;
95
96
__functor = functor ;
101
102
matchNot = regex : self ( c : mapAttr ( f c ) "filterf" ( andNot ( matchesRegex regex ) ) ) ;
102
103
map = mapf : self ( c : mapAttr ( f c ) "mapf" ( compose mapf ) ) ;
103
104
addPath = path : self ( c : mapAttr ( f c ) "paths" ( p : p ++ [ path ] ) ) ;
104
- addAPI = api : self ( c : mapAttr ( f c ) "api" ( a : a // builtins . mapAttrs ( _ : g : g ( self f ) ) api ) ) ;
105
+ addAPI = api : self ( c : mapAttr ( f c ) "api" ( a : a // api ) ) ;
105
106
106
107
# Configuration updates (non-accumulating)
107
108
withLib = lib : self ( c : ( f c ) // { inherit lib ; } ) ;
You can’t perform that action at this time.
0 commit comments