aboutsummaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-03-31 12:38:31 +0000
committerLudovic Courtès <ludo@gnu.org>2010-03-31 12:38:31 +0000
commit09381cccffe675ccbc8d183f043788f99dc018cd (patch)
tree0c38ffd9438be5422dc871c75abd7b5b19ee11da /tests/lang
parent471419d1fac21412dea9a47eff200d44cd75d825 (diff)
Make source location info in the XML output optional.
* src/libexpr/expr-to-xml.cc (nix::showAttrs): Add `location' parameter. Provide location XML attributes when it's true. Update callers. (nix::printTermAsXML): Likewise. * src/libexpr/expr-to-xml.hh (nix::printTermAsXML): Update prototype; have `location' default to `false'. * src/nix-instantiate/nix-instantiate.cc (printResult, processExpr): Add `location' parameter; update callers. (run): Add support for `--no-location'. * src/nix-instantiate/help.txt: Update accordingly. * tests/lang.sh: Invoke `nix-instantiate' with `--no-location' for the XML tests. * tests/lang/eval-okay-toxml.exp, tests/lang/eval-okay-to-xml.nix: New files.
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-okay-toxml.exp1
-rw-r--r--tests/lang/eval-okay-toxml.nix3
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-toxml.exp b/tests/lang/eval-okay-toxml.exp
new file mode 100644
index 000000000..379f3c076
--- /dev/null
+++ b/tests/lang/eval-okay-toxml.exp
@@ -0,0 +1 @@
+Str("<?xml version='1.0' encoding='utf-8'?>\n<expr>\n <attrs>\n <attr name=\"a\">\n <string value=\"s\" />\n </attr>\n </attrs>\n</expr>\n",[])
diff --git a/tests/lang/eval-okay-toxml.nix b/tests/lang/eval-okay-toxml.nix
new file mode 100644
index 000000000..068c97a6c
--- /dev/null
+++ b/tests/lang/eval-okay-toxml.nix
@@ -0,0 +1,3 @@
+# Make sure the expected XML output is produced; in particular, make sure it
+# doesn't contain source location information.
+builtins.toXML { a = "s"; }