Files
Wez Furlong 3839b58d94 bounce classifier: make match order more predictable
Previously, the use of BTreeMap for the rules resulted in the overall
rule order being changed in a surprising way; the key order of the map
set the overall order by category and then by the order that the rules
appeared in the file.

This commit uses an OrderMap to preserve the ordering of the keys
in the TOML (or JSON) file so that they match the order in which
they appear in the file, rather than having them become implicit
sorted by key.

Secondly, it removes the use of BTreeMap in the overall classifier
state, so that the all of the patterns are presented in the order
in which they appeared in the sequence of files loaded in the classifier
setup.

A unit test has been added to assert that matching of ambiguous (in this
case, identical) patterns takes its precedence from the order that the
patterns appear in the file.
2024-08-06 20:50:59 -07:00
..