pfw-custom-dump

Pretty-print, diff, and assert Swift data structures with CustomDump.

16|2|Updated Mar 29, 2018
One-click install
npx skills add https://github.com/khoi/dotfiles --skill pfw-custom-dump-khoi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pfw-custom-dump
Source: https://github.com/khoi/dotfiles/tree/main/chezmoi/dot_pfw/skills/custom-dump
Command: npx skills add https://github.com/khoi/dotfiles --skill pfw-custom-dump-khoi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Swift tests often struggle to visualize and compare complex data structures; this skill provides a straightforward way to pretty-print values, generate meaningful diffs, and assert differences using the CustomDump library.

Core Features & Use Cases

  • Pretty-print Swift values with readable formatting for easier debugging.
  • Generate diffs between expected and actual values to highlight changes in tests.
  • Use robust assertions (like expectDifference and expectNoDifference) to validate behavior without rewriting data structures.

Quick Start

Add the CustomDump dependency to your Swift project and import CustomDump in tests to start pretty-printing, diffing, and asserting on Swift data structures.

Frequently Asked Questions about pfw-custom-dump

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pretty-print Swift data structures for easier debugging?

To pretty-print Swift data structures, use the CustomDump library to format values into a readable output. This provides clear visual representations of complex data during development workflows.

How do I generate readable diffs between expected and actual values in Swift tests?

You can generate readable diffs in Swift tests by applying the CustomDump library to compare expected and actual values. It highlights specific changes in complex data structures to visualize test failures.

What is the best way to assert differences on Swift values without rewriting data structures?

The best way to assert differences on Swift values without rewriting data structures is using CustomDump assertions like expectDifference and expectNoDifference. These validate behavior directly within existing testing patterns.

Do I need to add CustomDump as a dependency to use these Swift testing features?

Yes, you need to add the CustomDump dependency to your Swift project and import it in your tests. This integration enables you to start pretty-printing, diffing, and asserting on Swift data structures.

Why do my Swift unit tests struggle to visualize complex data structures?

Swift unit tests often struggle to visualize complex data structures because standard assertions lack clear visual diffs. The CustomDump library solves this by providing straightforward pretty-printing and meaningful diff generation.