Overhaul plugin metadata types' comparison operators

Change their implementations to check full object equality, with case insensitivity for filename strings.

The filename case insensitivity doesn't extend to filenames in condition strings, as conditions are compared as strings, but the risk of duplicates due to that is much less than the risk of treating non-duplicate objects as duplicates.
This commit is contained in:
Oliver Hamlet
2020-07-11 19:13:07 +01:00
parent 8188806286
commit 15076a6d26
27 changed files with 521 additions and 157 deletions
+3 -1
View File
@@ -42,7 +42,9 @@ This structure holds information on which versions of a plugin are dirty or clea
Equality
--------
Two cleaning data structures are equal if the values of their ``crc`` keys are identical.
Two plugin cleaning data structures are equal if all their fields are equal.
`util` field equality is case-sensitive. If the `info` field is a string, it
is treated as a localised content data structure.
Examples
--------
+2 -1
View File
@@ -26,7 +26,8 @@ The scalar form is simply the value of the map form's ``name`` key. Using the sc
Equality
--------
Two file data structures are equal if the lowercased values of their ``name`` keys are identical.
Two file data structures are equal if all their fields are equal. ``name`` field
equality is case-insensitive, the other fields use case-sensitive equality.
Examples
--------
@@ -27,3 +27,9 @@ The localised content data structure is a key-value string map.
Spanish es
Swedish sv
==================== =====
Equality
--------
Two localised content data structures are equal if all their fields are equal.
Field equality is case-sensitive.
+2 -1
View File
@@ -22,7 +22,8 @@ The scalar form is simply the value of the map form's ``link`` key. Using the sc
Equality
--------
Two location data structures are equal if the values of their ``link`` keys are identical.
Two location data structures are equal if all their fields are equal. Field
equality is case-sensitive.
Examples
--------
+5 -2
View File
@@ -57,8 +57,11 @@ If a message's ``content`` value is a string, the message will use the string as
Equality
--------
The equality of two message data structures is determined by comparing the values of their ``content`` keys. If a content key is a string, it is treated as a localised content list
containing a single English-language string. The two message data structures are then equal if their localised content lists are identical.
Two message data structures are equal if their `type`, `content` and `condition`
fields are equal, after any `subs` values have been substituted into `content`
strings. If the `content` field is a string, it is treated as a localised
content list containing a single English-language string. String equality is
case sensitive.
Examples
--------
+2 -1
View File
@@ -22,7 +22,8 @@ The scalar form is simply the value of the map form's ``name`` key. Using the sc
Equality
--------
Two tag data structures are equal if the values of their ``name`` keys are identical.
Two tag data structures are equal if all their fields are equal. String equality
is case-sensitive.
Examples
--------