nix-super/tests/functional
Robert Hensing 9b88bf8adf Fix underflow in Printer::printAttrs
The code that counts the number of elided attrs incorrectly used the
per-printer "global" attribute counter instead of a counter that
was relevant only to the current attribute set.

This bug flew under the radar because often the attribute sets aren't
nested, not big enough, or we wouldn't pay attention to the numbers.
I've noticed the issue because the difference underflowed.

Although this behavior is tested by the functional test
lang/eval-fail-bad-string-interpolation-4.nix, the underflow slipped
through review. A simpler reproducer would be as follows, but I
haven't added it to the test suite to keep it simple and marginally
faster.

```
$ nix run nix/2.23.1 -- eval --expr '"" + (let v = { a = { a = 1; b = 2; c = 1; d = 1; e = 1; f = 1; g = 1; h = 1; }; b = { a = 1; b = 1; c = 1; }; }; in builtins.deepSeq v v)'
error:
       … while evaluating a path segment
         at «string»:1:6:
            1| "" + (let v = { a = { a = 1; b = 2; c = 1; d = 1; e = 1; f = 1; g = 1; h = 1; }; b = { a = 1; b = 1; c = 1; }; }; in builtins.deepSeq v v)
             |      ^

       error: cannot coerce a set to a string: { a = { a = 1; b = 2; c = 1; d = 1; e = 1; f = 1; g = 1; h = 1; }; b = { a = 1; «4294967289 attributes elided» }; }
```
2024-06-29 13:53:05 +02:00
..
ca tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
characterisation Factor out a bit more language testings infra 2024-06-23 15:33:45 -04:00
common tests/functional: Print all args of fail() 2024-06-24 18:11:58 +02:00
config Add functional tests for include directive in nix config file 2024-04-02 18:10:36 -07:00
derivation Functional test for derivation "advanced attrs" 2024-06-23 21:42:56 -04:00
dyn-drv tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
flakes Test that commit-lock-file-summary and its alias work 2024-06-28 14:53:40 -07:00
git-hashing tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
lang Fix underflow in Printer::printAttrs 2024-06-29 13:53:05 +02:00
local-overlay-store tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
nested-sandboxing Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
plugins Split out GlobalConfig into its own header 2024-06-24 11:36:21 -04:00
test-libstoreconsumer Allow for ergnomically putting Unix-only files in subdirs by creating INLCUDE_$(pkg) vars 2024-03-27 12:01:59 -04:00
add.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
bash-profile.sh housekeeping: shellcheck for tests/functional/bash-profile.sh 2024-06-12 16:58:25 -04:00
big-derivation-attr.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
binary-cache-build-remote.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
binary-cache.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
brotli.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
build-delete.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
build-dry.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
build-hook-ca-fixed.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
build-hook-ca-floating.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
build-hook.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
build-remote-content-addressed-fixed.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
build-remote-content-addressed-floating.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
build-remote-input-addressed.sh tests: Add hydraJobs.tests.functional_* 2024-06-20 14:54:11 +02:00
build-remote-trustless-after.sh Shellcheck some test scripts 2024-05-28 12:32:22 -04:00
build-remote-trustless-should-fail-0.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
build-remote-trustless-should-pass-0.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
build-remote-trustless-should-pass-1.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
build-remote-trustless-should-pass-2.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
build-remote-trustless-should-pass-3.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
build-remote-trustless.sh Shellcheck some test scripts 2024-05-28 12:32:22 -04:00
build-remote-with-mounted-ssh-ng.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
build-remote.sh Shellcheck some test scripts 2024-05-28 12:32:22 -04:00
build.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
ca-shell.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
case-hack.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
case.nar Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
characterisation-test-infra.sh Factor out a bit more language testings infra 2024-06-23 15:33:45 -04:00
check-refs.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
check-refs.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
check-reqs.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
check-reqs.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
check.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
check.sh Merge branch 'master' into fix-sandbox-escape 2024-06-26 18:11:39 -04:00
chroot-store.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
common.sh Shellcheck some test scripts 2024-05-28 12:32:22 -04:00
completions.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
compression-levels.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
compute-levels.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
config.nix.in Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
config.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
db-migration.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
debugger.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
dependencies.builder0.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
dependencies.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
dependencies.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
derivation-advanced-attributes.sh Functional test for derivation "advanced attrs" 2024-06-23 21:42:56 -04:00
derivation-json.sh housekeeping: shellcheck for tests/functional/derivation-json.sh 2024-06-12 17:41:16 -04:00
dummy Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
dump-db.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
eval-store.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
eval.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
eval.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
experimental-features.sh housekeeping: shellcheck for tests/functional/experimental-features.sh 2024-06-12 17:41:16 -04:00
export-graph.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
export-graph.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
export.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
extra-sandbox-profile.nix libstore: check additionalSandboxProfile 2024-05-06 17:37:08 +02:00
extra-sandbox-profile.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
failing.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
fetchClosure.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
fetchGit.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
fetchGitRefs.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
fetchGitSubmodules.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
fetchGitVerification.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
fetchMercurial.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
fetchPath.sh housekeeping: shellcheck for tests/functional/fetchPath.sh 2024-06-12 17:41:16 -04:00
fetchTree-file.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
fetchurl.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
filter-source.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
filter-source.sh housekeeping: shellcheck for tests/functional/filter-source.sh 2024-06-12 17:41:16 -04:00
fixed.builder1.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
fixed.builder2.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
fixed.nix Make outputHashAlgo accept "nar", stay in sync 2024-04-09 16:17:23 -04:00
fixed.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
fmt.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
fmt.simple.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
fod-failing.nix nix3-build: show all FOD errors with --keep-going 2024-05-17 18:48:52 +02:00
function-trace.sh housekeeping: shellcheck for tests/functional/function-trace.sh 2024-06-12 17:41:16 -04:00
gc-auto.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
gc-concurrent.builder.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
gc-concurrent.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
gc-concurrent.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
gc-concurrent2.builder.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
gc-non-blocking.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
gc-runtime.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
gc-runtime.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
gc.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
hash-check.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
hash-convert.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
hash-path.sh housekeeping: shellcheck for tests/functional/hash-path.sh 2024-06-12 17:41:16 -04:00
help.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
hermetic.nix Activate hermetic.nix variation only for new layered store tests 2024-02-29 10:06:53 -05:00
ifd.nix remote-store test: Break out IFD expression into a separate file 2023-12-23 17:15:09 -05:00
import-derivation.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
import-derivation.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
impure-derivations.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
impure-derivations.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
impure-env.nix Allow CLI to pass environment variables to FOD builder (#8830) 2023-10-11 11:58:42 +00:00
impure-env.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
impure-eval.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
install-darwin.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
lang.sh Factor out a bit more language testings infra 2024-06-23 15:33:45 -04:00
legacy-ssh-store.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
linux-sandbox-cert-test.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
linux-sandbox.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
local.mk Functional test for derivation "advanced attrs" 2024-06-23 21:42:56 -04:00
logging.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
misc.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
multiple-outputs.nix Fix empty outputsToInstall for InstallableAttrPath 2024-06-02 14:26:18 +03:00
multiple-outputs.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
nar-access.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
nar-access.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
nested-sandboxing.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
nix-build-examples.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
nix-build.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
nix-channel.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
nix-collect-garbage-d.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
nix-copy-ssh-common.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
nix-copy-ssh-ng.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
nix-copy-ssh.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
nix-daemon-untrusting.sh Arbitrarily bring back some nix-daemon calls 2024-01-13 11:27:04 -08:00
nix-profile.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
nix-shell.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
nix_path.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
optimise-store.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
output-normalization.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
parallel.builder.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
parallel.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
parallel.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
pass-as-file.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
path-from-hash-part.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
path-info.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
path.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
placeholders.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
plugins.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
post-hook.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
pure-eval.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
pure-eval.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
push-to-store-old.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
push-to-store.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
read-only-store.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
readfile-context.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
readfile-context.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
recursive.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
recursive.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
referrers.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
remote-store.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
repair.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
repl.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
restricted.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
restricted.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
search.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
search.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
secure-drv-outputs.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
secure-drv-outputs.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
selfref-gc.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
shell-hello.nix nix shell: Test that store paths cannot link outside of the store 2024-04-11 11:06:35 +02:00
shell.nix Do not rely on $stdenv/setup to set output variables 2024-04-10 19:50:19 +03:00
shell.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
shell.shebang.nix tests: test nix-shell shebang quoting 2023-10-23 17:32:50 +02:00
shell.shebang.rb Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
shell.shebang.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
signing.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
simple-failing.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
simple.builder.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
simple.nix add regression test for nix edit 2024-05-31 12:58:47 +02:00
simple.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
ssh-relay.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
store-info.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
structured-attrs-shell.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
structured-attrs.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
structured-attrs.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
substitute-with-invalid-ca.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
suggestions.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
supplementary-groups.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
symlink-derivation.nix Fix the access of symlinks to host files in the sandbox 2024-04-12 15:57:53 +02:00
tarball.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
test-infra.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
test-libstoreconsumer.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
timeout.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
timeout.sh tests/functional/timeout.sh: Find missing test case 2024-06-20 14:54:11 +02:00
toString-path.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
undefined-variable.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
user-envs-migration.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
user-envs-test-case.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00
user-envs.builder.sh Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
user-envs.nix Put functional tests in tests/functional 2023-10-06 09:05:56 -04:00
user-envs.sh Ensure all functional scripts are (a) executable (b) have shebang 2024-05-28 12:46:24 -04:00
why-depends.sh tests/functional: Enable more tests in NixOS VM 2024-06-20 14:54:11 +02:00
zstd.sh tests/functional: Skip tests that don't work in NixOS environment yet 2024-06-20 14:54:11 +02:00