refactor: remove pocketbase (#1138)

This commit is contained in:
Jonas Plum
2025-09-02 21:58:08 +02:00
committed by GitHub
parent f28c238135
commit eba2615ec0
435 changed files with 42677 additions and 4730 deletions

View File

@@ -0,0 +1,39 @@
package service
import (
"encoding/json"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_marshal(t *testing.T) {
t.Parallel()
data := map[string]any{"a": 1}
out := marshal(data)
var res map[string]any
err := json.Unmarshal([]byte(out), &res)
require.NoError(t, err, "invalid json")
v, ok := res["a"].(float64)
assert.True(t, ok, "key 'a' not found or not float64")
assert.InEpsilon(t, float64(1), v, 0, "unexpected marshal result")
}
func Test_unmarshal(t *testing.T) {
t.Parallel()
jsonStr := json.RawMessage(`{"c":3}`)
m := unmarshal(jsonStr)
v, ok := m["c"].(float64)
assert.True(t, ok, "key 'c' not found or not float64")
assert.InEpsilon(t, float64(3), v, 0, "unexpected unmarshal result")
assert.Nil(t, unmarshal(json.RawMessage("invalid")), "expected nil for invalid json")
}