carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package park
2
3import (
4 "github.com/carlosframework/platform/internal/hostclaim"
5 "testing"
6)
7
8func TestPlan13HolderProjectionPreservesEvidence(t *testing.T) {
9 h := hostclaim.Holder{Admissions: []hostclaim.AdmissionRecord{{Region: "ie", PredecessorRegion: HomeRegion}, {Region: "uk", PredecessorRegion: ""}}}
10 got := HolderRegionView(h, "ie", "ie")
11 if got.Admissions[0].PredecessorRegion != "ie" || got.Admissions[1].Region != "uk" || got.Admissions[1].PredecessorRegion != "" {
12 t.Fatal(got)
13 }
14 if h.Admissions[0].PredecessorRegion != HomeRegion {
15 t.Fatal("rewrote input")
16 }
17 got = HolderRegionView(h, "ie", HomeRegion)
18 if got.Admissions[0].Region != HomeRegion {
19 t.Fatal(got)
20 }
21 got = HolderRegionView(h, "", "uk")
22 if got.Admissions[0].Region != "ie" || got.Admissions[0].PredecessorRegion != HomeRegion {
23 t.Fatal("unbound alias")
24 }
25}
26