diff options
author | Robert Helgesson <robert@rycee.net> | 2021-10-03 11:28:03 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2021-10-03 11:28:03 +0200 |
commit | e75f346aa309515fa220f6d2124a27f72e245b69 (patch) | |
tree | 9980881c64dd5b4f9b4076abde8a62414a7d7f30 /lib/tests/misc.nix | |
parent | a7eb89bdba881d71c49b94ea3e12af9b8b10768d (diff) | |
download | nixpkgs-e75f346aa309515fa220f6d2124a27f72e245b69.tar nixpkgs-e75f346aa309515fa220f6d2124a27f72e245b69.tar.gz nixpkgs-e75f346aa309515fa220f6d2124a27f72e245b69.tar.bz2 nixpkgs-e75f346aa309515fa220f6d2124a27f72e245b69.tar.lz nixpkgs-e75f346aa309515fa220f6d2124a27f72e245b69.tar.xz nixpkgs-e75f346aa309515fa220f6d2124a27f72e245b69.tar.zst nixpkgs-e75f346aa309515fa220f6d2124a27f72e245b69.zip |
lib: add function escapeXML
Given a string, this function returns a string that can be inserted verbatim in an XML document.
Diffstat (limited to 'lib/tests/misc.nix')
-rw-r--r-- | lib/tests/misc.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 00eeaa2a77d..7b3a6b4e60b 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -246,6 +246,11 @@ runTests { }; }; + testEscapeXML = { + expr = escapeXML ''"test" 'test' < & >''; + expected = ""test" 'test' < & >"; + }; + # LISTS testFilter = { |