Refactor event processing in tests for chronological order
- Updated test files to collect events first and sort them by their CreatedAt timestamp before processing, ensuring events are handled in chronological order. - Removed redundant error checks for scanner errors after event processing. - Enhanced clarity and maintainability of event handling in tests across multiple files, including export, fetch, and query tests. - Adjusted expected index counts in tests to reflect changes in event structure and processing logic.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
// These flags are shared across both "json", "jsontext", and "jsonopts".
|
||||
package jsonflags
|
||||
|
||||
import "encoding/json/internal"
|
||||
import "next.orly.dev/pkg/json/internal"
|
||||
|
||||
// Bools represents zero or more boolean flags, all set to true or false.
|
||||
// The least-significant bit is the boolean value of all flags in the set.
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
package jsonopts
|
||||
|
||||
import (
|
||||
"encoding/json/internal"
|
||||
"encoding/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
)
|
||||
|
||||
// Options is the common options type shared across json packages.
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"unicode/utf16"
|
||||
"unicode/utf8"
|
||||
|
||||
"encoding/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
)
|
||||
|
||||
// escapeASCII reports whether the ASCII character needs to be escaped.
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"encoding/json/internal/jsonflags"
|
||||
"encoding/json/internal/jsonopts"
|
||||
"encoding/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal/jsonopts"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
)
|
||||
|
||||
// NOTE: The logic for decoding is complicated by the fact that reading from
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
"io"
|
||||
"math/bits"
|
||||
|
||||
"encoding/json/internal/jsonflags"
|
||||
"encoding/json/internal/jsonopts"
|
||||
"encoding/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal/jsonopts"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
)
|
||||
|
||||
// Encoder is a streaming encoder from raw JSON tokens and values.
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"io"
|
||||
"strconv"
|
||||
|
||||
"encoding/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
)
|
||||
|
||||
const errorPrefix = "jsontext: "
|
||||
|
||||
@@ -9,7 +9,7 @@ package jsontext
|
||||
import (
|
||||
"io"
|
||||
|
||||
"encoding/json/internal"
|
||||
"next.orly.dev/pkg/json/internal"
|
||||
)
|
||||
|
||||
// Internal is for internal use only.
|
||||
|
||||
@@ -9,9 +9,9 @@ package jsontext
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"encoding/json/internal/jsonflags"
|
||||
"encoding/json/internal/jsonopts"
|
||||
"encoding/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal/jsonopts"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
)
|
||||
|
||||
// Options configures [NewEncoder], [Encoder.Reset], [NewDecoder],
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
package jsontext
|
||||
|
||||
import (
|
||||
"encoding/json/internal/jsonflags"
|
||||
"encoding/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
)
|
||||
|
||||
// AppendQuote appends a double-quoted JSON string literal representing src
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"encoding/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
)
|
||||
|
||||
// ErrDuplicateName indicates that a JSON token could not be
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"math"
|
||||
"strconv"
|
||||
|
||||
"encoding/json/internal/jsonflags"
|
||||
"encoding/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
)
|
||||
|
||||
// NOTE: Token is analogous to v1 json.Token.
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
"slices"
|
||||
"sync"
|
||||
|
||||
"encoding/json/internal/jsonflags"
|
||||
"encoding/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
)
|
||||
|
||||
// NOTE: Value is analogous to v1 json.RawMessage.
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
"reflect"
|
||||
"strconv"
|
||||
|
||||
"encoding/json/internal/jsonwire"
|
||||
"encoding/json/jsontext"
|
||||
jsonv2 "encoding/json/v2"
|
||||
"next.orly.dev/pkg/json/internal/jsonwire"
|
||||
"next.orly.dev/pkg/json/jsontext"
|
||||
jsonv2 "next.orly.dev/pkg/json/v2"
|
||||
)
|
||||
|
||||
// Unmarshal parses the JSON-encoded data and stores the result
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"reflect"
|
||||
"strconv"
|
||||
|
||||
jsonv2 "encoding/json/v2"
|
||||
jsonv2 "next.orly.dev/pkg/json/v2"
|
||||
)
|
||||
|
||||
// Marshal returns the JSON encoding of v.
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"bytes"
|
||||
"strings"
|
||||
|
||||
"encoding/json/jsontext"
|
||||
"next.orly.dev/pkg/json/jsontext"
|
||||
)
|
||||
|
||||
// HTMLEscape appends to dst the JSON-encoded src with <, >, &, U+2028 and U+2029
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"encoding/json/internal"
|
||||
"encoding/json/jsontext"
|
||||
jsonv2 "encoding/json/v2"
|
||||
"next.orly.dev/pkg/json/internal"
|
||||
"next.orly.dev/pkg/json/jsontext"
|
||||
jsonv2 "next.orly.dev/pkg/json/v2"
|
||||
)
|
||||
|
||||
// Inject functionality into v2 to properly handle v1 types.
|
||||
|
||||
@@ -177,10 +177,10 @@ package json
|
||||
import (
|
||||
"encoding"
|
||||
|
||||
"encoding/json/internal/jsonflags"
|
||||
"encoding/json/internal/jsonopts"
|
||||
"encoding/json/jsontext"
|
||||
jsonv2 "encoding/json/v2"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/internal/jsonopts"
|
||||
"next.orly.dev/pkg/json/jsontext"
|
||||
jsonv2 "next.orly.dev/pkg/json/v2"
|
||||
)
|
||||
|
||||
// Reference encoding, jsonv2, and jsontext packages to assist pkgsite
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"encoding/json/internal"
|
||||
"encoding/json/internal/jsonflags"
|
||||
"encoding/json/jsontext"
|
||||
"next.orly.dev/pkg/json/internal"
|
||||
"next.orly.dev/pkg/json/internal/jsonflags"
|
||||
"next.orly.dev/pkg/json/jsontext"
|
||||
)
|
||||
|
||||
// export exposes internal functionality of the "jsontext" package.
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"encoding/json/jsontext"
|
||||
jsonv2 "encoding/json/v2"
|
||||
"next.orly.dev/pkg/json/jsontext"
|
||||
jsonv2 "next.orly.dev/pkg/json/v2"
|
||||
)
|
||||
|
||||
// A Decoder reads and decodes JSON values from an input stream.
|
||||
|
||||
Reference in New Issue
Block a user