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 | |
parent | a7eb89bdba881d71c49b94ea3e12af9b8b10768d (diff) |
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')
-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 00eeaa2a77d7..7b3a6b4e60b8 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 = { |