package replay_test

import (
	_ "embed"
	"encoding/json"
	"testing"

	"git.sunturtle.xyz/zephyr/horse/umadump/replay"
	"github.com/google/go-cmp/cmp"
)

//go:embed simdata-Mihono_Bourbon-74.2421s-20260829.json
var hakurakuGold []byte

func TestDecodeSim(t *testing.T) {
	var want replay.RaceSimulateData
	if err := json.Unmarshal(hakurakuGold, &want); err != nil {
		panic(err)
	}
	const b = "[encoded data, 14764 characters]"
	got, err := replay.DecodeSim(b)
	if err != nil {
		t.Errorf("decode: %v", err)
	}
	if diff := cmp.Diff(&want, got); diff != "" {
		t.Errorf("wrong result (+got/-want):\n%s", diff)
	}
}
