gitgram/aitimemachine/beads/cmd/bd/dolt_remote_json_test.go
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

47 lines
1.2 KiB
Go

package main
import (
"encoding/json"
"testing"
"github.com/steveyegge/beads/internal/storage"
)
func TestFormatDoltRemoteListJSONPreservesCompatibilityShape(t *testing.T) {
remotes := []storage.RemoteInfo{
{Name: "origin", URL: "dolthub://example/beads"},
}
payload, err := json.Marshal(formatDoltRemoteListJSON(remotes))
if err != nil {
t.Fatalf("marshal remote list JSON: %v", err)
}
var got []map[string]any
if err := json.Unmarshal(payload, &got); err != nil {
t.Fatalf("unmarshal remote list JSON: %v", err)
}
if len(got) != 1 {
t.Fatalf("len(got) = %d, want 1", len(got))
}
entry := got[0]
if entry["name"] != "origin" {
t.Fatalf("name = %v, want origin", entry["name"])
}
if entry["url"] != "dolthub://example/beads" {
t.Fatalf("url = %v, want remote URL", entry["url"])
}
if entry["sql_url"] != "dolthub://example/beads" {
t.Fatalf("sql_url = %v, want remote URL", entry["sql_url"])
}
if entry["status"] != "ok" {
t.Fatalf("status = %v, want ok", entry["status"])
}
if _, ok := entry["Name"]; ok {
t.Fatal("remote list JSON should not expose capitalized Go field Name")
}
if _, ok := entry["URL"]; ok {
t.Fatal("remote list JSON should not expose capitalized Go field URL")
}
}