···159 # but this is not fully specified, so let's tie this too much to the currently implemented concept of store paths.
160 # Similar reasoning applies to the validity of the name part.
161 # We care more about discerning store path-ness on realistic values. Making it airtight would be fragile and slow.
162- && match ".{32}-.+" (elemAt components storeDirLength) != null;
000000163164in
165# No rec! Add dependencies on this file at the top.
···159 # but this is not fully specified, so let's tie this too much to the currently implemented concept of store paths.
160 # Similar reasoning applies to the validity of the name part.
161 # We care more about discerning store path-ness on realistic values. Making it airtight would be fragile and slow.
162+ && match ".{32}-.+" (elemAt components storeDirLength) != null
163+ # alternatively match content‐addressed derivations, which _currently_ do
164+ # not have a store directory prefix.
165+ # This is a workaround for https://github.com/NixOS/nix/issues/12361 which
166+ # was needed during the experimental phase of ca-derivations and should be
167+ # removed once the issue has been resolved.
168+ || match "[0-9a-z]{52}" (head components) != null;
169170in
171# No rec! Add dependencies on this file at the top.
+10
lib/path/tests/unit.nix
···137 expected = true;
138 };
1390000000000140 # Test examples from the lib.path.subpath.isValid documentation
141 testSubpathIsValidExample1 = {
142 expr = subpath.isValid null;
···1-{ runCommand, fontbakery }:
000023let
4- inherit (fontbakery) pname version src;
5in
67-runCommand "${pname}-tests" { meta.timeout = 5; } ''
8 # Check the version matches what we packaged.
9- ${fontbakery}/bin/fontbakery --version | grep -q "${version}"
1011 # Unpack src to get some test fonts.
12- tar -xzf ${src} --strip-components=1 ${pname}-${version}/data/test
1314 # Run some font checks.
15- ${fontbakery}/bin/fontbakery check-ufo --no-progress --no-colors data/test/test.ufo >>$out
16 # TODO add more
17''
···1+{
2+ fontbakery,
3+ lib,
4+ runCommand,
5+}:
67let
8+ inherit (fontbakery) version src;
9in
1011+runCommand "fontbakery-tests" { meta.timeout = 5; } ''
12 # Check the version matches what we packaged.
13+ ${lib.getExe fontbakery} --version | grep -q "${version}"
1415 # Unpack src to get some test fonts.
16+ tar -xzf ${src} --strip-components=1 fontbakery-${version}/data/test
1718 # Run some font checks.
19+ ${lib.getExe fontbakery} check-ufo --no-progress --no-colors data/test/test.ufo >>$out
20 # TODO add more
21''