From 9f723ceaa9264e70ca6238282294ba2cf2e3e739 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sat, 1 Jan 2022 16:21:34 +0000 Subject: Array functions --- test/gleam_json_test.gleam | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/gleam_json_test.gleam b/test/gleam_json_test.gleam index dae51b6..8fe256d 100644 --- a/test/gleam_json_test.gleam +++ b/test/gleam_json_test.gleam @@ -41,18 +41,24 @@ pub fn encode_object_test() { |> should_encode("{\"foo\":5}") } -pub fn encode_list_test() { - json.list([json.int(5), json.int(6)]) +pub fn encode_array_test() { + [5, 6, 1, 4] + |> json.array(of: json.int) + |> should_encode("[5,6,1,4]") +} + +pub fn encode_preprocessed_array_test() { + json.preprocessed_array([json.int(5), json.int(6)]) |> should_encode("[5,6]") } pub fn encode_nullable_some_test() { - json.nullable(Some(5), the: json.int) + json.nullable(Some(5), of: json.int) |> should_encode("5") } pub fn encode_nullable_none_test() { - json.nullable(None, the: json.int) + json.nullable(None, of: json.int) |> should_encode("null") } -- cgit v1.2.3