Share edit location and check protected names in full segments
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/glossary"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/schema"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposals"
|
||||
frameworkvalidators "gitea.maximumdirect.net/eric/audita/v3/internal/framework/validators"
|
||||
@@ -78,9 +79,11 @@ func TestNewRejectsProtectedTermChangeOutsideGlossaryStage(t *testing.T) {
|
||||
}
|
||||
|
||||
req := contracts.ValidationRequest{
|
||||
ModuleKey: "homophones",
|
||||
Glossary: tinyGlossary(),
|
||||
ProtectedTerms: glossary.Vocabulary(tinyGlossary(), nil),
|
||||
WorkingTranscript: &schema.Transcript{Segments: []schema.Segment{{ID: 1, Text: "Jesters"}}},
|
||||
ReplacementPolicy: proposals.ReplacementPolicyRequireUnique,
|
||||
ModuleKey: "homophones",
|
||||
Glossary: tinyGlossary(),
|
||||
ProtectedTerms: glossary.Vocabulary(tinyGlossary(), nil),
|
||||
CandidateProposal: []proposals.EnrichedCorrectionProposal{
|
||||
proposal(0, "homophones", "Jesters", "Gestures"),
|
||||
},
|
||||
@@ -113,9 +116,11 @@ func TestNewGlossaryStageRejectsProtectedTermChange(t *testing.T) {
|
||||
}
|
||||
|
||||
req := contracts.ValidationRequest{
|
||||
ModuleKey: "glossary",
|
||||
Glossary: tinyGlossary(),
|
||||
ProtectedTerms: glossary.Vocabulary(tinyGlossary(), nil),
|
||||
WorkingTranscript: &schema.Transcript{Segments: []schema.Segment{{ID: 1, Text: "Jesters"}}},
|
||||
ReplacementPolicy: proposals.ReplacementPolicyRequireUnique,
|
||||
ModuleKey: "glossary",
|
||||
Glossary: tinyGlossary(),
|
||||
ProtectedTerms: glossary.Vocabulary(tinyGlossary(), nil),
|
||||
CandidateProposal: []proposals.EnrichedCorrectionProposal{
|
||||
proposal(0, "glossary", "Jesters", "Gestures"),
|
||||
},
|
||||
@@ -142,9 +147,11 @@ func TestNewGlossaryStageAllowsProtectedTermInsertion(t *testing.T) {
|
||||
}
|
||||
|
||||
req := contracts.ValidationRequest{
|
||||
ModuleKey: "glossary",
|
||||
Glossary: tinyGlossary(),
|
||||
ProtectedTerms: glossary.Vocabulary(tinyGlossary(), nil),
|
||||
WorkingTranscript: &schema.Transcript{Segments: []schema.Segment{{ID: 1, Text: "gestures"}}},
|
||||
ReplacementPolicy: proposals.ReplacementPolicyRequireUnique,
|
||||
ModuleKey: "glossary",
|
||||
Glossary: tinyGlossary(),
|
||||
ProtectedTerms: glossary.Vocabulary(tinyGlossary(), nil),
|
||||
CandidateProposal: []proposals.EnrichedCorrectionProposal{
|
||||
proposal(0, "glossary", "gestures", "Jesters"),
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/glossary"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/modulecatalog"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/schema"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposals"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/validators/editorial_review"
|
||||
@@ -163,9 +164,11 @@ func TestResolveBuiltInChainUsesGlossaryStageProtectedTermsBehavior(t *testing.T
|
||||
}
|
||||
|
||||
req := contracts.ValidationRequest{
|
||||
ModuleKey: "glossary",
|
||||
ProtectedTerms: glossary.Vocabulary([]glossary.Entry{{Collection: "party", ID: "jesters", Name: "Jesters"}}, nil),
|
||||
Glossary: []glossary.Entry{{Collection: "party", ID: "jesters", Name: "Jesters", Category: "faction", Description: "Protected"}},
|
||||
WorkingTranscript: &schema.Transcript{Segments: []schema.Segment{{ID: 1, Text: "Jesters"}}},
|
||||
ReplacementPolicy: proposals.ReplacementPolicyReplaceAll,
|
||||
ModuleKey: "glossary",
|
||||
ProtectedTerms: glossary.Vocabulary([]glossary.Entry{{Collection: "party", ID: "jesters", Name: "Jesters"}}, nil),
|
||||
Glossary: []glossary.Entry{{Collection: "party", ID: "jesters", Name: "Jesters", Category: "faction", Description: "Protected"}},
|
||||
CandidateProposal: []proposals.EnrichedCorrectionProposal{
|
||||
{
|
||||
CorrectionProposal: proposals.CorrectionProposal{
|
||||
|
||||
Reference in New Issue
Block a user