Files
bd2/go/cmd/bd2server/main_test.go
T
Flechazo 113e941bef feat: expand gameplay and state persistence
- add character imprint, awakening, and equipment refinement

- add equipment ticket gacha and persistent progression fields

- add request-scoped account transactions with crash recovery

- persist age confirmation and isolate client plugin patches

- separate one-off save repair tools from shipped tooling
2026-09-23 00:55:36 +08:00

22 lines
686 B
Go

package main
import (
"path/filepath"
"testing"
)
func TestValidateAccountStatePathsRequiresOneTransactionDirectory(t *testing.T) {
root := t.TempDir()
progress := filepath.Join(root, "progress.json")
deck := filepath.Join(root, "deck.json")
if err := validateAccountStatePaths(root, progress, deck); err != nil {
t.Fatal(err)
}
if err := validateAccountStatePaths(root, filepath.Join(root, "renamed.json"), deck); err == nil {
t.Fatal("renamed progress escaped transaction allow-list")
}
if err := validateAccountStatePaths(root, progress, filepath.Join(t.TempDir(), "deck.json")); err == nil {
t.Fatal("deck outside account transaction directory was accepted")
}
}