diff options
author | Florian Klink <flokli@flokli.de> | 2024-01-23T12·30+0200 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2024-01-24T14·00+0000 |
commit | adff7be4d15e9c038e1600559d5d7226023c3c73 (patch) | |
tree | 49f43b72f358b3cc539ef8a2c4af50ef8476d678 /tvix/eval/src/builtins | |
parent | 8e517bc8d04da60f1851aa44000ad7400817e522 (diff) |
feat(tvix/eval): expose value_to_xml for test cases r/7446
It's debateable on whether the serialization code should be exposed a bit more prominently or not. Change-Id: Iff7a28f884b1490b12b145dfdadbedacb84fd387 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10684 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 3 | ||||
-rw-r--r-- | tvix/eval/src/builtins/to_xml.rs | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 81d30e91c689..dc3ea3fc15d4 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -27,6 +27,9 @@ use self::versions::{VersionPart, VersionPartsIter}; mod to_xml; mod versions; +#[cfg(test)] +pub use to_xml::value_to_xml; + #[cfg(feature = "impure")] mod impure; diff --git a/tvix/eval/src/builtins/to_xml.rs b/tvix/eval/src/builtins/to_xml.rs index 6d486d356518..250891b60d99 100644 --- a/tvix/eval/src/builtins/to_xml.rs +++ b/tvix/eval/src/builtins/to_xml.rs @@ -11,7 +11,7 @@ use crate::{ErrorKind, Value}; /// Recursively serialise a value to XML. The value *must* have been /// deep-forced before being passed to this function. -pub(super) fn value_to_xml<W: Write>(mut writer: W, value: &Value) -> Result<(), ErrorKind> { +pub fn value_to_xml<W: Write>(mut writer: W, value: &Value) -> Result<(), ErrorKind> { let config = EmitterConfig { perform_indent: true, pad_self_closing: true, |