From c4ae41eba5e1c86c9a1edcaf80ef10cc3fe62eb1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 10 Feb 2023 15:18:39 -0700 Subject: compat/json: Run the example tests --- compat/json/borrowed_example_marshaling_test.go | 3 ++- compat/json/borrowed_example_test.go | 7 ++++++- compat/json/borrowed_example_text_marshaling_test.go | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/compat/json/borrowed_example_marshaling_test.go b/compat/json/borrowed_example_marshaling_test.go index 44a7c5d..e1af4df 100644 --- a/compat/json/borrowed_example_marshaling_test.go +++ b/compat/json/borrowed_example_marshaling_test.go @@ -7,10 +7,11 @@ package json_test import ( - "encoding/json" "fmt" "log" "strings" + + "git.lukeshu.com/go/lowmemjson/compat/json" ) type Animal int diff --git a/compat/json/borrowed_example_test.go b/compat/json/borrowed_example_test.go index fd984cd..5c612eb 100644 --- a/compat/json/borrowed_example_test.go +++ b/compat/json/borrowed_example_test.go @@ -8,12 +8,13 @@ package json_test import ( "bytes" - "encoding/json" "fmt" "io" "log" "os" "strings" + + "git.lukeshu.com/go/lowmemjson/compat/json" ) func ExampleMarshal() { @@ -85,6 +86,7 @@ func ExampleDecoder() { // Ed: Go fmt yourself! } +/* // MODIFIED: we don't have tokens // This example uses a Decoder to decode a stream of distinct JSON values. func ExampleDecoder_Token() { const jsonStream = ` @@ -121,7 +123,9 @@ func ExampleDecoder_Token() { // float64: 1.234 // json.Delim: } } +*/ // MODIFIED: we don't have tokens +/* // MODIFIED: we don't have tokens // This example uses a Decoder to decode a streaming array of JSON objects. func ExampleDecoder_Decode_stream() { const jsonStream = ` @@ -173,6 +177,7 @@ func ExampleDecoder_Decode_stream() { // Ed: Go fmt yourself! // json.Delim: ] } +*/ // MODIFIED: we don't have tokens // This example uses RawMessage to delay parsing part of a JSON message. func ExampleRawMessage_unmarshal() { diff --git a/compat/json/borrowed_example_text_marshaling_test.go b/compat/json/borrowed_example_text_marshaling_test.go index 3bfcd34..821851c 100644 --- a/compat/json/borrowed_example_text_marshaling_test.go +++ b/compat/json/borrowed_example_text_marshaling_test.go @@ -7,10 +7,11 @@ package json_test import ( - "encoding/json" "fmt" "log" "strings" + + "git.lukeshu.com/go/lowmemjson/compat/json" ) type Size int -- cgit v1.2.3-2-g168b