# How values that overlap are resolved, and which pattern the redaction is
# attributed to.
#
# No built-in pattern states these rules. Two of them do overlap, and one value
# does contain another — a stateless installation token carries a JWT, and the
# signature of a JWT swallows a token written after it — and a case somewhere in
# the corpus covers one span with two of them, which is the rule reading the
# order they were added in. TestCorpus_attributionIsExercised counts the cases
# reaching that rule and names each one it finds, so no sentence here has to
# name a file a case can be moved out of. What the cases below state is every
# rule rather than the corner of them the built-ins happen to reach, with
# patterns looking for a given substring, so that the input a case is written
# against can be read at a glance rather than decoded. The letters say where the
# values are; nothing about them is a credential.
#
# Values that overlap are redacted together as one, and the combined text is
# attributed to the pattern that located the value starting earliest; among
# those, the longest; among those, the one added first.

patterns: earlier-and-later

case:     values that overlap are redacted as one
in:       xxabcdefxx
out:      xx«early»xx

case:     values that do not overlap stay apart
in:       abcdxxcdef
out:      «early»xx«late»

case:     patterns that find nothing
in:       nothing here at all
out:      nothing here at all

patterns: earlier-and-later-reversed

case:     the earlier value is attributed however the patterns were ordered
in:       xxabcdefxx
out:      xx«early»xx

patterns: same-start

case:     on the same start the longest value is attributed
in:       abcdefxx
out:      «long»efxx

patterns: same-start-reversed

case:     on the same start the longest is attributed however the patterns were ordered
in:       abcdefxx
out:      «long»efxx

patterns: same-span

case:     on the same span the pattern added first is attributed
in:       abcdxx
out:      «first»xx

patterns: same-span-reversed

case:     on the same span the order of the patterns decides, not the name
in:       abcdxx
out:      «second»xx

patterns: containing

case:     a value inside another is redacted as part of it
in:       abcdef
out:      «outer»

patterns: containing-reversed

case:     a value inside another is attributed to the containing one whatever the order
in:       abcdef
out:      «outer»

patterns: chained

case:     a chain of overlaps merges into one value
in:       abcdefg
out:      «first»

case:     a chain that stops short leaves the rest alone
in:       abcxxefgxx
out:      «first»xx«third»xx

patterns: adjacent

case:     values that touch but do not overlap stay apart
in:       abcd
out:      «first»«second»

case:     touching values twice over
in:       abcdabcd
out:      «first»«second»«first»«second»
