broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'case-fold':([x for x in d['options'] if d['query'].casefold() in x.casefold()]), 'selected-preserve':(list(d['selected'])), 'search-clear':(list(d['options'])), 'hidden-count':(len(d['selected'])), 'no-option-message':(not any(d['query'].casefold() in x.casefold() for x in d['options'])), 'search-all-target':([x for x in d['options'] if d['query'].casefold() in x.casefold() and x not in d['disabled']])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []})], 2: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []})], 3: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']})], 4: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']})], 5: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'case-fold':([x for x in d['options'] if d['query'].casefold() in x.casefold()]), 'selected-preserve':(list(d['selected'])), 'search-clear':(list(d['options'])), 'hidden-count':(sum(d['query'].casefold() in x.casefold() for x in d['selected'])), 'no-option-message':(not any(d['query'].casefold() in x.casefold() for x in d['options'])), 'search-all-target':([x for x in d['options'] if d['query'].casefold() in x.casefold() and x not in d['disabled']])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []})], 2: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []})], 3: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']})], 4: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']})], 5: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Hidden-selection badges count selected values outside the search is violated by the widget projection.

Searching inside a facet section affects visible options only; selected hidden choices remain part of the filter and empty query restores the full option list. This example checks: Hidden-selection badges count selected values outside the search.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'case-fold':([x for x in d['options'] if d['query'].casefold() in x.casefold()]), 'selected-preserve':(list(d['selected'])), 'search-clear':(list(d['options'])), 'hidden-count':(sum(d['query'].casefold() not in x.casefold() for x in d['selected'])), 'no-option-message':(not d['options']), 'search-all-target':([x for x in d['options'] if d['query'].casefold() in x.casefold() and x not in d['disabled']])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})], 2: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': False, 'search-all-target': ['Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})], 3: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']})], 4: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']})], 5: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'case-fold':([x for x in d['options'] if d['query'].casefold() in x.casefold()]), 'selected-preserve':(list(d['selected'])), 'search-clear':(list(d['options'])), 'hidden-count':(sum(d['query'].casefold() not in x.casefold() for x in d['selected'])), 'no-option-message':(not any(d['query'].casefold() in x.casefold() for x in d['selected'])), 'search-all-target':([x for x in d['options'] if d['query'].casefold() in x.casefold() and x not in d['disabled']])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})], 2: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': False, 'search-all-target': ['Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})], 3: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']})], 4: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']})], 5: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
No-options messaging depends on searchable options rather than selected values is violated by the widget projection.

Searching inside a facet section affects visible options only; selected hidden choices remain part of the filter and empty query restores the full option list. This example checks: No-options messaging depends on searchable options rather than selected values.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'case-fold':([x for x in d['options'] if d['query'].casefold() in x.casefold()]), 'selected-preserve':(list(d['selected'])), 'search-clear':(list(d['options'])), 'hidden-count':(sum(d['query'].casefold() not in x.casefold() for x in d['selected'])), 'no-option-message':(not any(d['query'].casefold() in x.casefold() for x in d['options'])), 'search-all-target':(list(d['options']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})], 2: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})], 3: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['green', 'red'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']})], 4: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']})], 5: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'case-fold':([x for x in d['options'] if d['query'].casefold() in x.casefold()]), 'selected-preserve':(list(d['selected'])), 'search-clear':(list(d['options'])), 'hidden-count':(sum(d['query'].casefold() not in x.casefold() for x in d['selected'])), 'no-option-message':(not any(d['query'].casefold() in x.casefold() for x in d['options'])), 'search-all-target':([x for x in d['options'] if d['query'].casefold() in x.casefold()])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})], 2: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})], 3: [({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['green', 'red'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']})], 4: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['green', 'red'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['green', 'red'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['green', 'red']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': [], 'disabled': []}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['Blue'], 'disabled': []}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': [], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['red', 'Amber'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': []}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Blue', 'Black']})], 5: [({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['green', 'red'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 1, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['Blue'], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['green', 'red'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []}), ({'options': ['green', 'red'], 'query': 'zz', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['green', 'red'], 'hidden-count': 2, 'no-option-message': True, 'search-all-target': []}), ({'options': ['Amber', 'Blue', 'Black'], 'query': '', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'b', 'selected': ['red', 'Amber'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Amber', 'Blue', 'Black'], 'selected-preserve': ['red', 'Amber'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 1, 'no-option-message': False, 'search-all-target': ['Amber', 'Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'L', 'selected': ['Blue'], 'disabled': ['Blue', 'red']}, {'case-fold': ['Blue', 'Black'], 'selected-preserve': ['Blue'], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': False, 'search-all-target': ['Black']}), ({'options': ['Amber', 'Blue', 'Black'], 'query': 'zz', 'selected': [], 'disabled': ['Blue', 'red']}, {'case-fold': [], 'selected-preserve': [], 'search-clear': ['Amber', 'Blue', 'Black'], 'hidden-count': 0, 'no-option-message': True, 'search-all-target': []})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Select-visible search targets exclude disabled options is violated by the widget projection.

Searching inside a facet section affects visible options only; selected hidden choices remain part of the filter and empty query restores the full option list. This example checks: Select-visible search targets exclude disabled options.

split: open-access