Assisted-by: DeepSeek V4.1 Flash
This commit is contained in:
+4
-4
@@ -24,7 +24,7 @@ func TestSyntaxErrorMessage(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParseRejectsInvalidUTF8(t *testing.T) {
|
||||
_, err := Parse([]byte("v = \"\xff\"\n"))
|
||||
_, err := ParseMap([]byte("v = \"\xff\"\n"))
|
||||
if err == nil {
|
||||
t.Fatal("expected a UTF-8 validation error")
|
||||
}
|
||||
@@ -130,7 +130,7 @@ func TestUnmarshalIntoNilAny(t *testing.T) {
|
||||
func TestParseContextHonoursCancellation(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
if _, err := ParseContext(ctx, []byte("a = 1\n")); !errors.Is(err, context.Canceled) {
|
||||
if _, err := ParseMapContext(ctx, []byte("a = 1\n")); !errors.Is(err, context.Canceled) {
|
||||
t.Fatalf("ParseContext returned %v, want context.Canceled", err)
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ func TestContextRoundTrip(t *testing.T) {
|
||||
in := []byte(`title = "x"
|
||||
count = 3
|
||||
`)
|
||||
if _, err := ParseContext(context.Background(), in); err != nil {
|
||||
if _, err := ParseMapContext(context.Background(), in); err != nil {
|
||||
t.Fatalf("ParseContext: %v", err)
|
||||
}
|
||||
var out struct {
|
||||
@@ -987,7 +987,7 @@ func TestDecoderMaxInputSize(t *testing.T) {
|
||||
t.Errorf("err = %v, want it to name the limit", err)
|
||||
}
|
||||
// Parse carries the nesting default and no size limit.
|
||||
if _, err := Parse(doc); err != nil {
|
||||
if _, err := ParseMap(doc); err != nil {
|
||||
t.Fatalf("parse: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user