summaryrefslogtreecommitdiff
path: root/internal/caldata/stack_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/caldata/stack_test.go')
-rw-r--r--internal/caldata/stack_test.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/internal/caldata/stack_test.go b/internal/caldata/stack_test.go
index b9d5bfb..3c1cf3f 100644
--- a/internal/caldata/stack_test.go
+++ b/internal/caldata/stack_test.go
@@ -13,7 +13,7 @@ func TestStack(t *testing.T) {
os.WriteFile(filepath.Join(dir, "krakow.ini"),
[]byte("[layer]\nid = krakow\ntype = diocesan\n\n[st-stanislaus]\ndate = 05-08\nrank = solemnity\nclass = saint\ncolour = red\nname.pl = Św. Stanisława\n"), 0o644)
- layers, errs := Stack(dir, []string{"poland", "krakow"})
+ layers, errs := Stack("new", dir, []string{"poland", "krakow"})
if len(errs) != 0 {
t.Fatalf("unexpected errors: %v", errs)
}
@@ -32,7 +32,7 @@ func TestStackMissingLayerSkips(t *testing.T) {
dir := t.TempDir()
os.WriteFile(filepath.Join(dir, "good.ini"),
[]byte("[layer]\nid = good\n\n[x]\ndate = 01-02\nrank = memorial\nname.en = X\n"), 0o644)
- layers, errs := Stack(dir, []string{"good", "missing"})
+ layers, errs := Stack("new", dir, []string{"good", "missing"})
if len(errs) != 1 {
t.Fatalf("want 1 error for the missing layer, got %v", errs)
}
@@ -54,3 +54,15 @@ func TestLoadLayerDefaultsIDToStem(t *testing.T) {
t.Errorf("ID = %q, want myparish (from stem)", l.ID)
}
}
+
+func TestStackFormBase(t *testing.T) {
+ dir := t.TempDir()
+ efLayers, _ := Stack("old", dir, nil)
+ if efLayers[0].ID != "tridentine" {
+ t.Errorf("EF base = %q want tridentine", efLayers[0].ID)
+ }
+ ofLayers, _ := Stack("new", dir, nil)
+ if ofLayers[0].ID != "universal" {
+ t.Errorf("OF base = %q want universal", ofLayers[0].ID)
+ }
+}