Exercise document-root controls through the public API

This commit is contained in:
2026-11-02 00:44:04 +00:00
parent eb87a10e1c
commit cf9e2fd677
24 changed files with 196 additions and 91 deletions

View File

@@ -74,10 +74,10 @@ func TestSourceVersionEvidenceConversion(t *testing.T) {
}
func TestImportSelectionConversion(t *testing.T) {
file := writeRecordConfig(t, "configkit:\n imports:\n - glob: absent/*.yml\nvalue: main\n")
file := writeRecordConfig(t, "config:\n imports:\n - glob: absent/*.yml\nvalue: main\n")
internal := engineSourceInfoFromLoad(t, file, "source-1", engine.Options[recordConfig]{Imports: true})
converted := fromEngineSourceInfo(internal)
if len(converted.EmptyImportSelections) != 1 || converted.EmptyImportSelections[0].Path.String() != "/configkit/imports/0" ||
if len(converted.EmptyImportSelections) != 1 || converted.EmptyImportSelections[0].Path.String() != "/config/imports/0" ||
converted.EmptyImportSelections[0].Location.SourceID != internal.ID || converted.EmptyImportSelections[0].Location.Line != 3 ||
converted.EmptyImportSelections[0].Selector != ImportSelectorGlob {
t.Fatalf("converted selection evidence = %#v", converted.EmptyImportSelections)