dart-lang / dart-lang/test

Provide a way to customize pretty printing

Open
#2,347 1 comment 4 reactions 0 assignees View on GitHub
customer-flutter package:matcher type-enhancement
Dominant language
Dart
Stars
536
Forks
232
Avg merge
1d 10h
Merged PRs (30d)
10

Description

When expect notices an error, it outputs an Expected: Actual: Which: block of text.

The Actual: line, however, wraps the value in angle brackets.

Sometimes, the value I want to print isn't a literal value, it's just an English-prose vague description of the value (the value itself being a gigantic tree that takes pages and pages to print and that isn't useful to print in this context).

This is a feature request to have a way to provide a pretty printer for values, e.g. by implementing a particular interface, or by having the matchers provide the pretty printer for the value, and allowing this API to omit the angle brackets.

Contributor guide

Open the contributing guide

Research direction

Start at the expect failure output that assembles the Expected/Actual/Which block and trace how values are formatted. Compare the possible customization points described in the issue, then define tests for prose descriptions and for omitting angle brackets; done means callers can customize pretty printing for non-literal values.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.