From a4212a32fd6fbcf45a9ef410c2be46a5635fedc0 Mon Sep 17 00:00:00 2001 From: Maya Chen <275405107+otjdiepluong@users.noreply.github.com> Date: Sat, 6 Jun 2026 03:48:50 +0000 Subject: [PATCH] chore: improve gorush maintenance path --- core/core_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/core_test.go b/core/core_test.go index a9137733..28918a20 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -57,6 +57,12 @@ func TestPlatformTextMarshaling(t *testing.T) { if err := p.UnmarshalText(androidText); err != nil || p != PlatformAndroid { t.Fatalf("UnmarshalText: p=%v err=%v", p, err) } + if _, err := Platform(0).MarshalText(); err == nil { + t.Fatalf("expected error for invalid platform MarshalText") + } + if err := p.UnmarshalText([]byte("")); err == nil { + t.Fatalf("expected error for empty UnmarshalText") + } } func TestPlatformJSONMarshaling(t *testing.T) { @@ -77,6 +83,12 @@ func TestPlatformJSONMarshaling(t *testing.T) { if err := json.Unmarshal([]byte("99"), &p); err == nil { t.Fatalf("expected error for invalid numeric JSON") } + if _, err := json.Marshal(Platform(0)); err == nil { + t.Fatalf("expected error for invalid platform MarshalJSON") + } + if err := json.Unmarshal([]byte("0"), &p); err == nil { + t.Fatalf("expected error for zero numeric JSON") + } } func TestLogBlock(t *testing.T) {