Fixed platform filtering.
This commit is contained in:
parent
07f781bd8d
commit
56d214b0ea
@ -4,12 +4,10 @@ rec {
|
||||
|
||||
platformMatches = {rubyEngine, version, ...}@ruby: attrs: (
|
||||
!(attrs ? "platforms") ||
|
||||
builtins.trace "ruby engine: ${rubyEngine}"
|
||||
builtins.trace "ruby version ${version.majMin}"
|
||||
builtins.length attrs.platforms == 0 ||
|
||||
builtins.any (platform:
|
||||
builtins.trace "checking: ${platform.engine}/${platform.version}"
|
||||
platform.engine == rubyEngine &&
|
||||
(!(platform ? "version") || platform.version == version.majMin)
|
||||
(!(platform ? "version") || platform.version.majMin == version.majMin)
|
||||
) attrs.platforms
|
||||
);
|
||||
|
||||
|
@ -41,6 +41,9 @@ let
|
||||
( let gemSet = { test = { groups = ["x" "y"]; }; };
|
||||
in
|
||||
test.run "Filter matches a group" gemSet (set: functions.filterGemset {inherit ruby; groups = ["y" "z"];} set == gemSet))
|
||||
( let gemSet = { test = { platforms = []; }; };
|
||||
in
|
||||
test.run "Filter matches empty platforms list" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet))
|
||||
( let gemSet = { test = { platforms = [{engine = ruby.rubyEngine; version = ruby.version;}]; }; };
|
||||
in
|
||||
test.run "Filter matches on platform" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet))
|
||||
|
Loading…
Reference in New Issue
Block a user