fake

package
v0.1.0-dev10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fake provides a scorer.Scorer that decorates an existing scorer: it delegates to the wrapped implementation for the happy path, but injects an error when a change URI carries a failure marker of the form "sq-fake=<token>":

sq-fake=score-error -> non-nil error (the delegate is not called)

This lets tests exercise scorer error paths end-to-end (driven from a land request) while preserving real scoring behavior for unmarked changes. It is intended for examples and tests only, never production.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(resolver changeset.Resolver, delegate scorer.Scorer) scorer.Scorer

New returns a scorer.Scorer that delegates to the given scorer but returns an error when a change URI carries the "sq-fake=score-error" marker. The resolver resolves the batch's changes so the marker can be inspected; the delegate is the existing scorer implementation to wrap (e.g. heuristic or composite).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL