Skip to content

Commit dcf919c

Browse files
committed
New indexing model: fix validation-test/stdlib/Join.swift.gyb
1 parent 4750f3b commit dcf919c

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

validation-test/stdlib/Join.swift.gyb

+20-11
Original file line numberDiff line numberDiff line change
@@ -259,17 +259,26 @@ public let joinWithSeparatorTests = [
259259

260260
var JoinTestSuite = TestSuite("Join")
261261

262-
% from itertools import product
263-
% traversals = [ 'Forward', 'Bidirectional', 'RandomAccess' ]
264-
% base_kinds = [ 'Defaulted', 'Minimal' ]
265-
% collections = [
266-
% ('{}{}RangeReplaceableCollection'.format(base_kind, traversal), traversal)
267-
% for base_kind, traversal in product(base_kinds, traversals)
268-
% ]
269-
% other_array_types = [ 'Array', 'ArraySlice', 'ContiguousArray' ]
270-
% collections += [(array, 'RandomAccess') for array in other_array_types]
271-
272-
% for Base, traversal in collections:
262+
%{
263+
264+
from gyb_stdlib_support import (
265+
TRAVERSALS,
266+
sliceTypeName
267+
)
268+
269+
from itertools import product
270+
271+
base_kinds = [ 'Defaulted', 'Minimal' ]
272+
collections = [
273+
(base_kind + sliceTypeName(traversal=traversal, mutable=False, rangeReplaceable=True).replace('Slice', 'Collection'), traversal)
274+
for base_kind, traversal in product(base_kinds, TRAVERSALS)
275+
]
276+
other_array_types = [ 'Array', 'ArraySlice', 'ContiguousArray' ]
277+
collections += [(array, 'RandomAccess') for array in other_array_types]
278+
279+
}%
280+
281+
% for Base, TRAVERSALS in collections:
273282
% if Base not in other_array_types:
274283
% label = 'elements:'
275284
% else:

0 commit comments

Comments
 (0)