Skip to content

Commit

Permalink
fix test for latest MacOS Swift versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Apr 30, 2024
1 parent 83cf5bb commit 457ac3d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Tests/JSONAPITests/SparseFields/SparseFieldEncoderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 457ac3d

Please sign in to comment.