This repository has no description
21

Configure Feed

Select the types of activity you want to include in your feed.

fix: anioop

isabel (Jun 14, 2026, 11:20 AM +0100) 0b55b986 7e570e9a

+7 -57
+7 -3
default.nix
··· 1 - { lib, buildGoModule }: 1 + { 2 + lib, 3 + buildGoModule, 4 + gitMinimal, 5 + }: 2 6 buildGoModule (finalAttrs: { 3 7 pname = "snot"; 4 8 version = "0.1.0"; ··· 6 10 src = ./.; 7 11 8 12 vendorHash = "sha256-b/HJO+zvxFZHr+Z6TEw92VLjaTntaEVhlwFwSa0mLz4="; 9 - 10 - subPackages = [ "cmd/snot" ]; 11 13 12 14 ldflags = [ 13 15 "-s" ··· 15 17 "-X main.Version=${finalAttrs.version}" 16 18 "-X github.com/isabelroses/snot/internal/xrpc.version=${finalAttrs.version}" 17 19 ]; 20 + 21 + nativeCheckInputs = [ gitMinimal ]; 18 22 19 23 meta = { 20 24 description = "A tangled knot shim backed by a Forgejo instance";
-54
internal/state/migrate_test.go
··· 1 - package state 2 - 3 - import ( 4 - "encoding/json" 5 - "os" 6 - "path/filepath" 7 - "testing" 8 - ) 9 - 10 - func TestImportsLegacyJSON(t *testing.T) { 11 - dir := t.TempDir() 12 - 13 - rkeys := map[string]string{"3l5tid": "demo"} 14 - rb, _ := json.Marshal(rkeys) 15 - if err := os.WriteFile(filepath.Join(dir, "rkeys.json"), rb, 0o600); err != nil { 16 - t.Fatal(err) 17 - } 18 - 19 - dids := map[string]RepoDidInfo{ 20 - "did:plc:repo1": {User: "isabel", Repo: "demo", Key: []byte("plckey")}, 21 - } 22 - db, _ := json.Marshal(dids) 23 - if err := os.WriteFile(filepath.Join(dir, "repodids.json"), db, 0o600); err != nil { 24 - t.Fatal(err) 25 - } 26 - 27 - d, err := Open(dir) 28 - if err != nil { 29 - t.Fatal(err) 30 - } 31 - 32 - if got, ok := d.Rkeys().RepoByRkey("3l5tid"); !ok || got != "demo" { 33 - t.Errorf("rkey not imported: %q %v", got, ok) 34 - } 35 - info, ok := d.RepoDids().Get("did:plc:repo1") 36 - if !ok || info.Repo != "demo" || string(info.Key) != "plckey" { 37 - t.Errorf("repodid not imported: %+v %v", info, ok) 38 - } 39 - 40 - // Originals renamed to *.migrated (kept as backup, not re-imported). 41 - for _, name := range []string{"rkeys.json", "repodids.json"} { 42 - if _, err := os.Stat(filepath.Join(dir, name)); !os.IsNotExist(err) { 43 - t.Errorf("%s should have been renamed away", name) 44 - } 45 - if _, err := os.Stat(filepath.Join(dir, name+".migrated")); err != nil { 46 - t.Errorf("%s.migrated backup missing: %v", name, err) 47 - } 48 - } 49 - 50 - // Reopen: must not error or duplicate (table already populated, files gone). 51 - if _, err := Open(dir); err != nil { 52 - t.Fatalf("reopen after migration: %v", err) 53 - } 54 - }