Changelog for the selfie JVM libraries.
com.diffplug.selfie:selfie-lib:VERSION
com.diffplug.selfie:selfie-runner-junit5:VERSION
- can be used with JUnit4 via junit-vintage
- works with Kotest JVM
com.diffplug.selfie:selfie-runner-kotest:VERSION
- written in Kotlin Multiplatform The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Do not remove stale snapshot files when readonly is true. (#367)
toBeFile
now checks for duplicate writes and throws a more helpful error message if the file doesn't exist. (#277)
- The
coroutines
methods used to eagerly throw an exception if they were ever called from anywhere besides a Kotest method. Now they wait untiltoMatchDisk()
is called, because they can work just fine anywhere if you usetoBe
. (#247)
- Memoization (#219 implements #215)
- like
expectSelfie
, all are available asSelfie.cacheSelfie
or assuspend fun
incom.diffplug.selfie.coroutines
.
- like
val cachedResult: ByteArray = Selfie.cacheSelfieBinary { dalleJpeg() }.toBeFile("example.jpg")
val cachedResult: String = Selfie.cacheSelfie { someString() }.toBe("what it was earlier")
val cachedResult: T = Selfie.cacheSelfieJson { anyKotlinxSerializable() }.toBe("""{"key": "value"}""")
val cachedResult: T = Selfie.cacheSelfieBinarySerializable { anyJavaIoSerializable() }.toMatchDisk()
toBeBase64
andtoBeFile
for true binary comparison of binary snapshots and facets. (#224)- spaces in multiline string literals aren't always escaped. (#220)
- if the leading spaces in the string literal match the file's existing indentation
- BREAKING reordered a class hierarchy for better binary support. (#221)
- most users won't need to make any changes at all
- only exception is that
expectSelfie(byte[]).toBe
is now a compile error, must dotoBeBase64
- Kotest support.
- Add
SelfieExtension
to yourAbstractProjectConfig
. - Instead of calling
Selfie.expectSelfie
, callcom.diffplug.selfie.coroutines.expectSelfie
. selfie-runner-junit5
supports snapshots in regular JUnit tests and Kotest tests in the same project.selfie-runner-kotest
is a new selfie implemented in Kotlin Multiplatform, but doesn't support snapshots within regular JUnit tests.- Full docs at https://selfie.dev/jvm/kotest.
- Add
- Swap thread-local cache for thread-ignorant LRU to improve performance when used with coroutines. (#191)
- (no user-facing changes) replaced terrible platform-specific
Path
withTypedPath
. (#184) - (no user-facing changes) replaced
SnapshotStorage
withSnapshotSystem
+DiskStorage
. (#198) - (no user-facing changes) replaced most
synchronized
with CAS. (#199)
@ParameterizedTest
no longer has. (#140)- If a test class contained package-private methods and a single test method was run without the others, selfie would erroneously garbage collect disk snapshots for the other methods, now fixed. (#175 fixes #174)
- Selfie was erroneously garbage collecting snapshots when a test class contained no
@Test public
methods. (#124 fixes #123)
- Support for
@ParameterizedTest
. (#118) ArraySet<K>
has been added to the standard library alongsideArrayMap<K, V>
. (#119)- These have the strange property that if the key is
String
, then/
characters are sorted to be the lowest possible character.
- These have the strange property that if the key is
- We already smuggle errors from initialization to help debug them, and now we also smuggle errors that happen during test execution. (#117)
- Fix a garbage collection bug which occurred when a test method's name was a prefix of another test method's name. (#119)
- Fix
CompoundLens
for Java users.
- Full support for binary snapshots. (#108)
- Groovy multiline string values just go into
"
strings instead of"""
until we have a chance to implement them properly. (#107)
toBe("mismatched")
now gets rewritten in write mode- fully implemented the new control scheme (#74)
- integers get
_
separators for thousands, millions, etc
- Groovy multiline strings
- Binary
DiskSelfie.toMatchDisk
now returnsDiskSelfie
so that we can fluently chain inline assertions on facets.
- Publish
selfie-lib-jvm
andselfie-lib
to Maven Central.
- Publish
selfie-lib-jvm
instead of justselfie-lib
to Maven Central.
- Initial release, take 2.
- Initial release.