From 457ac3df7557bdb87d820d0efc3a4c1776363860 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Tue, 30 Apr 2024 11:10:33 -0500 Subject: [PATCH] fix test for latest MacOS Swift versions --- .../SparseFields/SparseFieldEncoderTests.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Tests/JSONAPITests/SparseFields/SparseFieldEncoderTests.swift b/Tests/JSONAPITests/SparseFields/SparseFieldEncoderTests.swift index 9d5bba5..2625989 100644 --- a/Tests/JSONAPITests/SparseFields/SparseFieldEncoderTests.swift +++ b/Tests/JSONAPITests/SparseFields/SparseFieldEncoderTests.swift @@ -43,13 +43,9 @@ class SparseFieldEncoderTests: XCTestCase { XCTAssertEqual(allThingsOnDeserialized["bool"] as? Bool, true) XCTAssertEqual(allThingsOnDeserialized["double"] as? Double, 10.5) XCTAssertEqual(allThingsOnDeserialized["string"] as? String, "hello") - #if os(Linux) - // There's some bug with Linux where it won't case the value to a float. - // It does exist and it is == 1.2 + // For latest versions of MacOS and all versions of Linux, floats + // decode as doubles. XCTAssertEqual(allThingsOnDeserialized["float"] as? Double, 1.2) - #else - XCTAssertEqual(allThingsOnDeserialized["float"] as? Float, 1.2) - #endif XCTAssertEqual(allThingsOnDeserialized["int"] as? Int, 3) XCTAssertEqual(allThingsOnDeserialized["int8"] as? Int8, 4) XCTAssertEqual(allThingsOnDeserialized["int16"] as? Int16, 5)