From 5eb89be68246f1e5a8cd28e48d5cec75921ca97a Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 10 Oct 2022 00:32:57 -0400 Subject: feat(tvix/eval): Implement builtins.fromJSON Using `serde_json` for parsing JSON here, plus an `impl FromJSON for Value`. The latter is primarily to stay "dependency light" for now - likely going with an actual serde `Deserialize` impl in the future is going to be way better as it allows saving significantly on intermediary allocations. Change-Id: I152a0448ff7c87cf7ebaac927c38912b99de1c18 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6920 Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.exp | 1 + 1 file changed, 1 insertion(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.exp (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.exp') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.exp new file mode 100644 index 000000000000..4f75c09231b6 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-fromjson.exp @@ -0,0 +1 @@ +[ { Image = { Animated = false; Height = 600; IDs = [ 116 943 234 38793 true false null -100 ]; Latitude = 37.7668; Longitude = -122.3959; Thumbnail = { Height = 125; Url = "http://www.example.com/image/481989943"; Width = 100; }; Title = "View from 15th Floor"; Width = 800; }; } { name = "a"; value = "b"; } ] -- cgit 1.4.1