Skip to content

Commit 63f36a8

Browse files
committed
Fixed tests of printing of floats after behavior change
debugDescription of all floating point numbers shows the number with greater precision, thus the tests had to be changed.
1 parent 10b61b7 commit 63f36a8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

test/1_stdlib/Interval.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ IntervalTestSuite.test("CustomStringConvertible/CustomDebugStringConvertible") {
169169
expectEqual("0.0...0.1", String(X(0.0)...X(0.1)))
170170

171171
expectEqual(
172-
"HalfOpenInterval(X(0.0)..<X(0.1))",
173-
String(reflecting: HalfOpenInterval(X(0.0)..<X(0.1))))
172+
"HalfOpenInterval(X(0.0)..<X(0.5))",
173+
String(reflecting: HalfOpenInterval(X(0.0)..<X(0.5))))
174174
expectEqual(
175-
"ClosedInterval(X(0.0)...X(0.1))",
176-
String(reflecting: ClosedInterval(X(0.0)...X(0.1))))
175+
"ClosedInterval(X(0.0)...X(0.5))",
176+
String(reflecting: ClosedInterval(X(0.0)...X(0.5))))
177177
}
178178

179179
IntervalTestSuite.test("rdar12016900") {

test/Interpreter/SDK/objc_cast.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,16 +426,18 @@ if let strArr = objImplicitOpt as? [String] {
426426
}
427427

428428
// Casting an array of numbers to different numbers.
429-
// CHECK: Numbers-as-doubles cast produces [3.14159, 2.71828, 0.0]
430-
obj = ([3.14159, 2.71828, 0] as [Double]) as AnyObject
429+
// CHECK: Numbers-as-doubles cast produces [3.9375, 2.71828, 0.0]
430+
obj = ([3.9375, 2.71828, 0] as [Double]) as AnyObject
431431
if let doubleArr = obj as? [Double] {
432+
print(sizeof(Double.self))
432433
print("Numbers-as-doubles cast produces \(doubleArr)")
433434
} else {
434435
print("Numbers-as-doubles failed")
435436
}
436437

437-
// CHECK: Numbers-as-floats cast produces [3.14159{{.*}}, 2.71828{{.*}}, 0.0]
438+
// CHECK: Numbers-as-floats cast produces [3.9375, 2.71828{{.*}}, 0.0]
438439
if let floatArr = obj as? [Float] {
440+
print(sizeof(Float.self))
439441
print("Numbers-as-floats cast produces \(floatArr)")
440442
} else {
441443
print("Numbers-as-floats failed")

0 commit comments

Comments
 (0)