File tree Expand file tree Collapse file tree 5 files changed +39
-0
lines changed Expand file tree Collapse file tree 5 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 358
358
options = checked options ;
359
359
config = checked ( removeAttrs config [ "_module" ] ) ;
360
360
_module = checked ( config . _module ) ;
361
+ modules = [ ] ;
361
362
inherit extendModules type class ;
362
363
} ;
363
364
in
513
514
disabledKeys = concatMap ( { file , disabled } : map ( moduleKey file ) disabled ) disabled ;
514
515
keyFilter = filter ( attrs : ! elem attrs . key disabledKeys ) ;
515
516
in
517
+ # CONITUE HERE ALI AND DAWN
516
518
map ( attrs : attrs . module ) ( genericClosure {
517
519
startSet = keyFilter modules ;
518
520
operator = attrs : keyFilter attrs . modules ;
Original file line number Diff line number Diff line change @@ -82,6 +82,24 @@ checkConfigOutput() {
82
82
fi
83
83
}
84
84
85
+ checkConfigOutputVerbatim () {
86
+ local expected=$1
87
+ shift
88
+ local actual
89
+ set +e
90
+ actual=$( evalConfig " $@ " 2> /dev/null)
91
+ set -e
92
+ if [[ " $actual " == " $expected " ]]; then
93
+ (( ++ pass))
94
+ else
95
+ logStartFailure
96
+ echo " ACTUAL:"
97
+ reportFailure " $@ "
98
+ echo " EXPECTED: '$expected '"
99
+ logFailure
100
+ logEndFailure
101
+ fi
102
+ }
85
103
checkConfigError () {
86
104
local errorContains=$1
87
105
local err=" "
@@ -305,6 +323,20 @@ checkConfigOutput '^12$' config.value ./declare-coerced-value-unsound.nix
305
323
checkConfigError ' A definition for option .* is not of type .*. Definition values:\n\s*- In .*: "1000"' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
306
324
checkConfigError ' toInt: Could not convert .* to int' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix
307
325
326
+ # Check `modules` attribute
327
+ expected='
328
+ [
329
+ {
330
+ "_file": "./modules/modules/root.nix",
331
+ "imports": [],
332
+ "type": "attrset"
333
+ }
334
+ ]
335
+ '
336
+
337
+ expected=$( echo " $expected " | jq --compact-output)
338
+ checkConfigOutputVerbatim " $expected " modules ./modules/root.nix
339
+
308
340
# Check mkAliasOptionModule.
309
341
checkConfigOutput ' ^true$' config.enable ./alias-with-priority.nix
310
342
checkConfigOutput ' ^true$' config.enableAlias ./alias-with-priority.nix
Original file line number Diff line number Diff line change 11
11
} )
12
12
config
13
13
options
14
+ modules
14
15
;
15
16
}
Original file line number Diff line number Diff line change
1
+ {
2
+
3
+ }
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ pkgs.runCommand "nixpkgs-lib-tests-nix-${nix.version}"
32
32
} )
33
33
] ;
34
34
nativeBuildInputs = [
35
+ pkgs . jq
35
36
nix
36
37
pkgs . gitMinimal
37
38
] ++ lib . optional pkgs . stdenv . hostPlatform . isLinux pkgs . inotify-tools ;
You can’t perform that action at this time.
0 commit comments