Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/stdlib/NumericParsing.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// RUN: %line-directive %t/NumericParsing.swift -- %target-run %t/a.out
// REQUIRES: executable_test
%{
from __future__ import division
from SwiftIntTypes import all_integer_types

word_bits = int(CMAKE_SIZEOF_VOID_P)
Expand All @@ -36,7 +37,7 @@ Note: the third parameter, zero, is not for user consumption.
else:
r = n % radix
digit = chr((ord('0') + r) if r < 10 else (ord('a') + r - 10))
return inRadix(radix, int(n / radix), '') + digit
return inRadix(radix, int(n // radix), '') + digit

# The maximal legal radix
max_radix = ord('z') - ord('a') + 1 + 10
Expand Down Expand Up @@ -96,7 +97,7 @@ tests.test("${Self}/success") {
% for radix in radices_to_test:
% for n in required_values + list(range(
% minValue + 1, maxValue - 1,
% int((maxValue - minValue - 2) / (number_of_values - len(required_values))))):
% int((maxValue - minValue - 2) // (number_of_values - len(required_values))))):
% prefix = '+' if n > 0 and n % 2 == 0 else '' # leading '+'
% text = inRadix(radix, n)
expectEqual(${n}, ${Self}("${prefix + text}", radix: ${radix}))
Expand Down