summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-10 15:18:39 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-10 21:48:22 -0700
commitc4ae41eba5e1c86c9a1edcaf80ef10cc3fe62eb1 (patch)
treee0143fe98828936c100de96826e3194ddf6acc07
parent04daa09e1911d7bdabe87e452200b2de2c5ca7c9 (diff)
compat/json: Run the example tests
-rw-r--r--compat/json/borrowed_example_marshaling_test.go3
-rw-r--r--compat/json/borrowed_example_test.go7
-rw-r--r--compat/json/borrowed_example_text_marshaling_test.go3
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