From 02d35e4aa6ef84cdbd01d881bdc5c1acd50fc7dc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 10 Jan 2023 14:52:59 +0300 Subject: feat(tvix/eval): implement builtins.toJSON Implements `Serialize` for `tvix_eval::Value`. Special care is taken with serialisation of attribute sets, and forcing of thunks. The tests should cover both cases well. Change-Id: I9bb135bacf6f87bc6bd0bd88cef0a42308e6c335 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7803 Reviewed-by: flokli Tested-by: BuildkiteCI Autosubmit: tazjin --- tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-literals.exp | 1 + 1 file changed, 1 insertion(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-literals.exp (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-literals.exp') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-literals.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-literals.exp new file mode 100644 index 0000000000..0a274c201f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-literals.exp @@ -0,0 +1 @@ +"[42,\"hello\",13.37,[],[1,2,3],{},{\"name\":\"foo\",\"value\":42},{\"foo\":42}]" -- cgit 1.4.1