home.social

#filepath — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #filepath, aggregated by home.social.

fetched live
  1. Generic XCTest assertions produce vague failure messages. Building custom assertion helpers with #filePath and #line preserves accurate failure locations while producing much clearer diagnostics. Small technique with outsized value for test quality.

    🔗: qualitycoding.org/swift-test-a by Jon Reid (@qcoding)

    #Swift #Testing #iOSDev

  2. Can anyone point me to an online Java compiler which runs the JDK on Windows? I only find Linux systems.

    I would be particularly interested in what

    java.nio.file.Path.of("a/b/c")

    returns on a Windows system. My hunch is that it is the same as

    java.nio.file.Path.of("a\\b\\c")

    because the forward slash, afair, also works as a path separator. Or is the forward slash merely a no-go character like ':' and many others?

    #java #windows #filepath #filename

  3. @nicklockwood The old assertions take

    file: StaticString = #filePath, line: UInt = #line

    The new ones are slightly different (String and Int), plus the extra fileID & column

  4. @polpielladev
    Yeah, thats what I meant. As I have very simple Packages and the only difference between them is the name, I now use this trick to dynamically generate the name of the package from its foldername:

    let name = String(#filePath.split(separator: "/").reversed()[1])

    This way, all the package.swift files are identical.

  5. TIL that how GitHub figures out syntax highlighting for Swift files is one huge plist file of 5000 lines maintained by TextMate and pulled in as a submodule into linguist. Hopefully this PR should also add proper syntax highlighting for `#filePath`: github.com/textmate/swift.tmbu

Share on Mastodon

Enter the server where you have an account.