~/talk

Swift Testing: A testing framework for modern Swift

Talkat #Pragma Conference 2024 · 2024-10-29..10-30· [testing, swift]
slides:none on file

A new Swift testing framework uses @test / @suite macros and runtime macros like pound expect / pound require to test an RPN stack (push, pop throws on empty) and an async timesTwo method; expect records failures and continues while require halts subsequent checks, parameterized tests run each case independently (maximum two parameters), suites run in parallel/random order unless marked serialized, supports knownIssue skipping and timeLimit, requires Swift 6 and has limited CLI tag filtering; custom macros add compile-time cost.

AI-written summary · about

  1. 0:00Introduction to Swift Testing
  2. 3:57Writing first test case
  3. 7:16Expect vs require expectations
  4. 9:24Eliminating test repetition
  5. 11:32Testing async code
  6. 14:53Handling known failures
  7. 16:19Time limits and skipping tests
  8. 18:07Parameterized testing
  9. 21:43Macros in Swift Testing
  10. 22:27Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.