Skip to content

Commit f8e6c30

Browse files
committed
[test] AnyHashable: Shorten class hierarchy tests
AnyHashable.swift.gyb is by far the longest test in debug builds of the test suite. Cut it dramatically shorter by reducing the number of equivalence classes checked in “containing classes from the <foo> hierarchy” tests from 16 down to 3. (It seems to me the extra test cases didn’t actually test any additional functionality.)
1 parent 9286b36 commit f8e6c30

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

validation-test/stdlib/AnyHashable.swift.gyb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,14 +510,15 @@ class ${Self.full_name} : ${Super.full_name} {}
510510

511511
AnyHashableTests.test("AnyHashable containing classes from the ${prefix} hierarchy") {
512512
typealias T = Int
513+
% bunch = 2
513514
let xs = [
514515
% for (i, (Self, _)) in enumerate(types):
515516
% ConcreteSelf = Self
516517
% if ConcreteSelf.is_generic:
517518
% ConcreteSelf = ConcreteSelf.specialize_with({'T':'Int'})
518519
% end
519-
${Self.full_name}(${len(types) + i}),
520-
% for j in range(0, len(types)):
520+
${Self.full_name}(${bunch + i}),
521+
% for j in range(0, bunch):
521522
${Self.full_name}(${j}),
522523
% end
523524
% end
@@ -526,7 +527,7 @@ AnyHashableTests.test("AnyHashable containing classes from the ${prefix} hierarc
526527
if lhs == rhs {
527528
return true
528529
}
529-
let p = ${len(types) + 1}
530+
let p = ${bunch + 1}
530531
if lhs % p == 0 || rhs % p == 0 {
531532
return false
532533
}

0 commit comments

Comments
 (0)