Ad
  • Custom User Avatar
    Fatal error: Unexpectedly found nil while unwrapping an Optional value: file test/main.swift, line 15
    

    Swift by default throws an error when something is null

    XCTAssertNil(buildOneTwoThree().next!.next!.next, "Value at index 3 should be null.");
    

    And not having the expected output of a test case where the output normally will be nil is not clear

  • Custom User Avatar

    Hi! Issues with swift, first one, the default func declaration has [Int] as parameter and [Int] as return type, when in the test cases Doubles are passed in the arrays, please change default function declaration for swift to func findUniq(_ arr: [Double]) -> Double

    Second, I hace three test cases where my func does not work, and I am not sure why

    XCTAssertEqual failed: ("8.0") is not equal to ("7.0") -
    XCTAssertEqual failed: ("3.0") is not equal to ("2.0") -
    XCTAssertEqual failed: ("2.0") is not equal to ("1.0") -