fluent API for snapshotting only specific subsets of a snapshot
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/selfie
-
Selfie JVM Snapshot Garbage Collection is overly zealous when using multiple test suites in gradle Openbug jvm
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
enhancement jvm
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
bug jvm
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug docs jvm
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
bug jvm py
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
2 rename bugs Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ankidroid/Anki-Android#21999 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
openwallet-foundation/multipaz#2028 ·
-
Improvement Java Platform: Java
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-java#6145 · 1 comment ·