Skip to content

Instantly share code, notes, and snippets.

@steipete
steipete / swift-testing-playbook.md
Last active February 19, 2026 08:25
The Ultimate Swift Testing Playbook (feed it your agents for better tests!)

The Ultimate Swift Testing Playbook (2024 WWDC Edition, expanded with Apple docs from June 2025)

Updated with info from https://developer.apple.com/documentation/testing fetched via Firecrawl on June 7, 2025.

See also my blog: See also my blog post: https://steipete.me/posts/2025/migrating-700-tests-to-swift-testing

A hands-on, comprehensive guide for migrating from XCTest to Swift Testing and mastering the new framework. This playbook integrates the latest patterns and best practices from WWDC 2024 and official Apple documentation to make your tests more powerful, expressive, and maintainable.


1. Migration & Tooling Baseline

@lukepearson
lukepearson / windows_10_bootable_iso.sh
Last active March 15, 2022 15:57
Create a bootable Windows 10 USB on MacOS
# Download the Windows 10 ISO
wget -O ~/Downloads/Windows10.iso https://software-download.microsoft.com/db/Win10_20H2_English_x64.iso?t=5f918d78-0088-47d5-adf9-8ccab64f2d3d&e=1604157841&h=675f0ae3a5a95da69c777d0d7031b8ec
# Mount the downloaded Windows 10 ISO
hdiutil mount ~/Downloads/Windows10.iso
# /dev/disk2 /Volumes/CCCOMA_X64FRE_EN-US_DV9
# Insert the USB stick (Minimum 8GB)
# Find the USB volume
@mattt
mattt / NSRange-Conventional.h
Last active January 22, 2020 23:32
Re-declaration of existing `NSRange` functions and implementation of new functions to match conventions of comparable Foundation and Core Foundation types.
NS_INLINE NSRange NSRangeMake(NSUInteger loc, NSUInteger len) {
return NSMakeRange(loc, len);
}
NS_INLINE NSUInteger NSRangeMax(NSRange range) {
return NSMaxRange(range);
}
NS_INLINE BOOL NSRangeContainsLocation(NSUInteger loc, NSRange range) {
return NSLocationInRange(loc, range);