guix/tests
Mark H Weaver 485ac28235
utils: Allow text substitution even in the presence of NUL characters.
Fixes <https://issues.guix.gnu.org/30116>.

Before this change, the presence of a NUL character on a line meant that
the (glibc) regexp engine used by Guile would either 1. stop scanning the
string or 2. crash with the error "string contains #\\nul character",
depending on the locale used.

This change works around this limitation by first replacing the NUL character
by an unused Unicode code point, doing the substitution, then reverting the
replacement.

* guix/build/utils.scm (unused-private-use-code-point)
(replace-char): New procedures.
(substitute): Make use of the above procedures to work around the NUL
character regexp engine limitation.
* tests/build-utils.scm: Add tests.

Co-authored-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-01-08 14:10:33 -05:00
..
services services: Add zram-device-service. 2020-08-02 15:54:37 +03:00
accounts.scm accounts: Delete duplicate entries. 2019-08-28 00:27:14 +02:00
base16.scm
base32.scm build: Remove references to the 'nix-hash' program. 2020-08-29 16:24:17 +02:00
base64.scm
boot-parameters.scm system: Add store-directory-prefix to boot-parameters. 2020-11-01 02:28:38 +01:00
bournish.scm
build-utils.scm utils: Allow text substitution even in the presence of NUL characters. 2021-01-08 14:10:33 -05:00
builders.scm tests: Remove expensive and pointless test. 2019-06-14 21:57:18 +02:00
cache.scm Remove workaround for 'time-monotonic' in Guile 2.2.2. 2020-03-22 16:49:47 +01:00
challenge.scm packages: Introduce <content-hash> and use it in <origin>. 2020-05-22 01:29:39 +02:00
channels.scm tests: Add missing copyright line. 2020-10-12 18:23:47 +02:00
civodul.key Add (guix openpgp). 2020-05-04 09:56:12 +02:00
combinators.scm
containers.scm linux-container: Reset jailed root permissions. 2020-10-01 12:51:13 +02:00
cpan.scm import: cpan: Rewrite tests to use an HTTP server instead of mocking. 2020-01-15 18:40:43 +01:00
cpio.scm
cran.scm import: cran: Avoid uses of '@@' in the tests. 2020-01-16 23:14:05 +01:00
crate.scm tests: Remove trailing commas in JSON tests. 2020-04-27 23:29:40 +02:00
cve-sample.json cve: Rewrite to read the JSON feed instead of the XML feed. 2019-10-23 16:40:17 +02:00
cve.scm cve: Rewrite to read the JSON feed instead of the XML feed. 2019-10-23 16:40:17 +02:00
debug-link.scm
derivations.scm packages: Introduce <content-hash> and use it in <origin>. 2020-05-22 01:29:39 +02:00
discovery.scm
dsa.key Add (guix openpgp). 2020-05-04 09:56:12 +02:00
ed25519.key Add (guix openpgp). 2020-05-04 09:56:12 +02:00
ed25519.sec Add (guix openpgp). 2020-05-04 09:56:12 +02:00
ed25519bis.key git-authenticate: Add tests. 2020-06-05 22:54:06 +02:00
ed25519bis.sec git-authenticate: Add tests. 2020-06-05 22:54:06 +02:00
elpa.scm import: elpa: Rewrite test to use an HTTP server instead of mocking. 2020-01-16 23:14:05 +01:00
file-systems.scm bootloader: grub: Allow booting from a Btrfs subvolume. 2020-05-20 08:30:35 -04:00
gem.scm tests: Remove trailing commas in JSON tests. 2020-04-27 23:29:40 +02:00
gexp.scm gexp: Warn when importing (guix config) or (ice-9 …). 2020-11-05 16:13:50 +01:00
git-authenticate.scm tests: Allow 'tests/git-authenticate.scm' to run when git/gpg is missing. 2020-06-28 23:26:53 +02:00
git.scm git: 'commit-difference' really excludes the ancestors of #:excluded. 2020-06-09 00:34:52 +02:00
glob.scm
gnu-maintenance.scm
grafts.scm Merge branch 'master' into core-updates 2019-06-27 23:33:48 +02:00
graph.scm graph: Adjust test for recent OCaml changes. 2020-10-20 16:30:15 +02:00
gremlin.scm gremlin: Add 'file-needed/recursive'. 2020-12-01 21:30:28 +01:00
guix-archive.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-authenticate.sh authenticate: Encode strings as ISO-8859-1. 2020-09-15 14:40:20 +02:00
guix-build-branch.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-build.sh packages: Better preserve object identity when rewriting. 2020-10-20 16:30:15 +02:00
guix-daemon.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-describe.sh
guix-download.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-environment-container.sh environment: Turn "lo" up in network-less containers. 2020-10-05 10:41:59 +02:00
guix-environment.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-gc.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-git-authenticate.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-graph.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-hash.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-lint.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-pack-localstatedir.sh
guix-pack-relocatable.sh pack: Relocatable wrapper leaves root available to child processes. 2020-10-31 23:16:43 +01:00
guix-pack.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-package-aliases.sh guix build: Record package transformations in manifest entries. 2020-10-02 23:28:09 +02:00
guix-package-net.sh tests: Simplify shell exit status negation; 2020-09-28 21:06:36 -05:00
guix-package.sh guix package: Re-apply package transformation when upgrading. 2020-10-02 23:28:09 +02:00
guix-repl.sh repl: Look for script files in (getcwd). 2020-09-16 16:04:01 +02:00
guix-system.sh tests: Test "guix system search .". 2020-11-06 16:38:12 +01:00
hackage.scm import: hackage: Add two expected failing test cases. 2019-06-20 14:07:01 +02:00
import-utils.scm import: utils: 'recursive-import' returns a list rather than a stream. 2019-12-11 12:13:03 +01:00
inferior.scm Merge branch 'master' into core-updates 2020-03-21 22:16:02 +01:00
lint.scm lint: Add 'check-haskell-stackage' checker. 2020-11-21 22:11:36 -05:00
modules.scm
monads.scm
nar.scm serialization: Add 'fold-archive'. 2019-12-12 17:56:57 +01:00
networking.scm services: ntp: Ensure no double quotes are output to config file. 2019-10-30 18:15:54 -04:00
offload.scm offload: Modify the build-machine record to accept multiple systems. 2020-08-25 13:45:27 -04:00
opam.scm tests: opam: Test additional syntax. 2020-10-02 00:44:14 +02:00
openpgp.scm openpgp: Fix argument order of 'fxbit-set?'. 2020-09-29 22:53:36 +02:00
pack.scm pack: Build the store database under a UTF-8 locale. 2020-07-20 23:25:09 +02:00
packages.scm Merge remote-tracking branch 'origin/master' into core-updates 2020-11-29 17:34:18 +00:00
pki.scm
print.scm tests: Update expected values for package->code. 2020-04-20 10:57:49 +02:00
processes.scm tests: processes: Skip tests if running with binfmt. 2019-12-10 10:49:42 +01:00
profiles.scm profiles: Add lowerable <profile> record type. 2020-04-26 22:49:48 +02:00
publish.scm publish: Create files in the cache as #o644. 2020-11-09 23:27:09 +01:00
pypi.scm utils: Remove compatibility re-export of 'memoize'. 2020-07-25 19:11:36 +02:00
records.scm records: Improve reporting of "invalid field specifier" errors. 2020-01-16 18:30:57 +01:00
rsa.key Add (guix openpgp). 2020-05-04 09:56:12 +02:00
scripts.scm
search-paths.scm build: Remove 'gnu/packages/bootstrap' and its binaries. 2019-06-14 22:09:38 +02:00
services.scm guix system: Add 'reconfigure' module. 2019-07-26 19:19:49 +02:00
sets.scm
signing-key.pub
signing-key.sec
size.scm
snix.scm
status.scm
store-database.scm store-database: Add test checking the directory mtime after 'register-path'. 2020-11-21 12:39:14 +01:00
store-deduplication.scm
store-roots.scm
store.scm tests: Remove one 'delete-paths' call in 'tests/store.scm'. 2020-09-14 15:42:56 +02:00
substitute.scm Use "guile-zlib" and "guile-lzlib" instead of (guix config). 2020-08-24 13:35:24 +02:00
swh.scm swh: Adjust 'origin' test. 2020-02-27 23:29:30 +01:00
syscalls.scm tests: Do not fail when network interface aliases are present. 2020-06-28 23:32:52 +02:00
system.scm
test.drv
texlive.scm import: texlive: Avoid uses of '@@' in tests. 2020-01-17 14:22:08 +01:00
transformations.scm guix build: Move transformation options to (guix transformations). 2020-10-31 23:16:43 +01:00
ui.scm tests: Adjust to 'show-manifest-transaction' changes. 2020-03-25 16:02:53 +01:00
union.scm tests: Make builds less expensive. 2019-06-14 21:57:39 +02:00
upstream.scm
utils.scm Use "guile-zlib" and "guile-lzlib" instead of (guix config). 2020-08-24 13:35:24 +02:00
uuid.scm
workers.scm