Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fluent API for snapshotting only specific subsets of a snapshot

Open
#482 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, kotlin
Domain
testing

Research direction

Start by inspecting the existing expectSelfie API and how snapshot values are matched. Clarify whether line selection and regex matching are still needed, define their semantics, and agree on the fluent API before identifying implementation and test locations.

Written by the indexing model from the issue text.

Description

enhancement

It would be nice to be able to truncate a snapshot to only certain specific lines. Something like:

expectSelfie(blah).lines(1).toBe_TODO() // first line
expectSelfie(blah).lines(2).toBe_TODO() // first two lines
expectSelfie(blah).lines(-2).toBe_TODO() // last two lines
expectSelfie(blah).lines(-1).toBe_TODO() // last one line

var snapshot = expectSelfie(blah)
snapshot.lines(2).toBe_TODO()  // first two lines
snapshot.lines(-2).toBe_TODO() // last two lines

I have also sometimes wanted to match a certain regex, like maybe

expectSelfie(blah).withinRegex("(?m)^.*$\n?^.*$").toBe_TODO()

So far, each time that I have wanted this, I have found a better way to solve this by filtering before the snapshot gets taken...

Dominant language
Kotlin
Stars
101
Forks
18
Avg merge
6d 11h
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/selfie

All issues in diffplug/selfie

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.