From fbd2326841005c1a288c65502dc038f26923ed65 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 7 Nov 2014 15:55:15 -0500 Subject: [PATCH] 4434: Assume only that if a"Bob" can be + # correct. Hopefully it _is_ safe to assume that if "a" comes + # before "b" in the ascii alphabet, "aX">"bY" is never true for + # any strings X and Y. + reliably_sortable_names = sorted_names.select do |name| + name[0] >= 'a' and name[0] <= 'z' + end.uniq do |name| + name[0] + end + # Array#& is documented to preserve order of sorted_names. + sorted_names &= reliably_sortable_names + actually_checked_anything = false previous = nil - sorted_entries.each do |entry| + sorted_names.each do |entry| if previous assert_operator(previous, operator, entry, - "Entries sorted incorrectly. Perhaps the application and database have mismatched locale settings?") + "Entries sorted incorrectly.") + actually_checked_anything = true end previous = entry end + assert actually_checked_anything, "Didn't even find two names to compare." end end -- 2.30.2