You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
11
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
12
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
12
13
13
14
## [Unreleased]
14
15
16
+
### Added
17
+
18
+
- Snapshot mismatch error messages now show a diff of the first mismatched line. ([#477](https://github.com/diffplug/selfie/pull/477))
19
+
- before
20
+
```
21
+
Snapshot mismatch
22
+
- update this snapshot by adding `_TODO` to the function name
23
+
- update all snapshots in this file by adding `//selfieonce` or `//SELFIEWRITE`
24
+
```
25
+
- after
26
+
```
27
+
Snapshot mismatch at L7:C9
28
+
-Testing 123
29
+
+Testing ABC
30
+
‣ update this snapshot by adding `_TODO` to the function name
31
+
‣ update all snapshots in this file by adding `//selfieonce` or `//SELFIEWRITE`
32
+
```
33
+
15
34
## [2.3.0] - 2024-07-11
35
+
16
36
### Added
37
+
17
38
- `DiskSelfie` now makes the `Snapshot actual` value public, so that other testing infrastructure can read from snapshotted values. ([#467](https://github.com/diffplug/selfie/pull/467))
39
+
18
40
### Fixed
41
+
19
42
- `cacheSelfie` was missing `@JvmOverloads` on the methods with default arguments. ([#425](https://github.com/diffplug/selfie/pull/425))
20
43
21
44
## [2.2.1] - 2024-06-05
45
+
22
46
### Fixed
47
+
23
48
- Added `Selfie.expectSelfies(Iterable<T> items, Function<T, String> toString)` for doing easy "multi-asserts" in `suspend fun` also. ([#421](https://github.com/diffplug/selfie/pull/421))
24
49
25
50
## [2.2.0] - 2024-06-04
51
+
26
52
### Added
53
+
27
54
- `SelfieSettingsAPI` now has a field `javaDontUseTripleQuoteLiterals` which ensures that multiline strings are always encoded as `"` strings. ([#417](https://github.com/diffplug/selfie/pull/417))
- For java versions which don't support multiline string literals, we now encode multiline strings like so: ([#406](https://github.com/diffplug/selfie/pull/406))
33
62
- ```java
34
63
toBe("line1",
35
64
"line2",
36
65
"line3");
37
66
```
67
+
38
68
### Changed
69
+
39
70
- Bump Kotlin to 2.0.0. ([#405](https://github.com/diffplug/selfie/pull/405))
71
+
40
72
### Fixed
73
+
41
74
- Do not remove stale snapshot files when readonly is true. ([#367](https://github.com/diffplug/selfie/pull/367))
42
75
- Provide more debugging info when a snapshot gets set multiple times. (helps with [#370](https://github.com/diffplug/selfie/issues/370))
43
76
44
77
## [2.0.2] - 2024-03-20
78
+
45
79
### Fixed
80
+
46
81
- `toBeFile` now checks for duplicate writes and throws a more helpful error message if the file doesn't exist. ([#277](https://github.com/diffplug/selfie/pull/277))
47
82
48
83
## [2.0.1] - 2024-02-24
84
+
49
85
### Fixed
86
+
50
87
- The `coroutines` methods used to eagerly throw an exception if they were ever called from anywhere besides a Kotest method. Now they wait until `toMatchDisk()` is called, because they can work just fine anywhere if you use `toBe`. ([#247](https://github.com/diffplug/selfie/pull/247))
- like `expectSelfie`, all are available as `Selfie.cacheSelfie` or as `suspend fun` in `com.diffplug.selfie.coroutines`.
94
+
- like `expectSelfie`, all are available as `Selfie.cacheSelfie` or as `suspend fun` in `com.diffplug.selfie.coroutines`.
95
+
56
96
```kotlin
57
97
val cachedResult: ByteArray = Selfie.cacheSelfieBinary { dalleJpeg() }.toBeFile("example.jpg")
58
98
val cachedResult: String = Selfie.cacheSelfie { someString() }.toBe("what it was earlier")
59
99
val cachedResult: T = Selfie.cacheSelfieJson { anyKotlinxSerializable() }.toBe("""{"key": "value"}""")
60
100
val cachedResult: T = Selfie.cacheSelfieBinarySerializable { anyJavaIoSerializable() }.toMatchDisk()
61
101
```
102
+
62
103
-`toBeBase64` and `toBeFile` for true binary comparison of binary snapshots and facets. ([#224](https://github.com/diffplug/selfie/pull/224))
63
104
- spaces in multiline string literals aren't always escaped. ([#220](https://github.com/diffplug/selfie/issues/220))
64
105
- if the leading spaces in the string literal match the file's existing indentation
106
+
65
107
### Changed
108
+
66
109
-**BREAKING** reordered a class hierarchy for better binary support. ([#221](https://github.com/diffplug/selfie/issues/221))
67
110
- most users won't need to make any changes at all
68
111
- only exception is that `expectSelfie(byte[]).toBe` is now a compile error, must do `toBeBase64`
69
112
70
113
## [1.2.0] - 2024-02-12
114
+
71
115
### Added
116
+
72
117
-**Kotest support**.
73
118
- Add `SelfieExtension` to your `AbstractProjectConfig`.
74
119
- Instead of calling `Selfie.expectSelfie`, call `com.diffplug.selfie.coroutines.expectSelfie`.
75
120
-`selfie-runner-junit5` supports snapshots in regular JUnit tests and Kotest tests in the same project.
76
121
-`selfie-runner-kotest` is a new selfie implemented in Kotlin Multiplatform, but doesn't support snapshots within regular JUnit tests.
77
122
- Full docs at https://selfie.dev/jvm/kotest.
123
+
78
124
### Fixed
125
+
79
126
- Swap thread-local cache for thread-ignorant LRU to improve performance when used with coroutines. ([#191](https://github.com/diffplug/selfie/pull/191))
127
+
80
128
### Changes
129
+
81
130
- (no user-facing changes) replaced terrible platform-specific `Path` with `TypedPath`. ([#184](https://github.com/diffplug/selfie/pull/184))
82
131
- (no user-facing changes) replaced `SnapshotStorage` with `SnapshotSystem` + `DiskStorage`. ([#198](https://github.com/diffplug/selfie/pull/198))
83
132
- (no user-facing changes) replaced most `synchronized` with CAS. ([#199](https://github.com/diffplug/selfie/pull/199))
84
133
85
134
## [1.1.2] - 2024-01-30
135
+
86
136
### Fixed
137
+
87
138
-`@ParameterizedTest` no longer has. ([#140](https://github.com/diffplug/selfie/issues/140))
88
139
- 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](https://github.com/diffplug/selfie/pull/175) fixes [#174](https://github.com/diffplug/selfie/issues/174))
89
140
90
141
## [1.1.1] - 2024-01-25
142
+
91
143
### Fixed
144
+
92
145
- Selfie was erroneously garbage collecting snapshots when a test class contained no `@Test public` methods. ([#124](https://github.com/diffplug/selfie/pull/124) fixes [#123](https://github.com/diffplug/selfie/issues/123))
93
146
94
147
## [1.1.0] - 2024-01-21
148
+
95
149
### Added
150
+
96
151
- Support for `@ParameterizedTest`. ([#118](https://github.com/diffplug/selfie/pull/118))
97
152
-`ArraySet<K>` has been added to the standard library alongside `ArrayMap<K, V>`. ([#119](https://github.com/diffplug/selfie/pull/119))
98
153
- These have the strange property that if the key is `String`, then `/` characters are sorted to be the lowest possible character.
154
+
99
155
### Fixed
156
+
100
157
- We already [smuggle errors from initialization](https://github.com/diffplug/selfie/pull/94) to help debug them, and now we also smuggle errors that happen during test execution. ([#117](https://github.com/diffplug/selfie/pull/117))
101
158
- Fix a garbage collection bug which occurred when a test method's name was a prefix of another test method's name. ([#119](https://github.com/diffplug/selfie/pull/119))
102
159
103
160
## [1.0.1] - 2024-01-19
161
+
104
162
### Fixed
163
+
105
164
- Fix `CompoundLens` for Java users.
106
165
107
166
## [1.0.0] - 2024-01-18
167
+
108
168
### Added
169
+
109
170
- Full support for binary snapshots. ([#108](https://github.com/diffplug/selfie/pull/108))
171
+
110
172
### Fixed
173
+
111
174
- Groovy multiline string values just go into `"` strings instead of `"""` until we have a chance to implement them properly. ([#107](https://github.com/diffplug/selfie/pull/107))
112
175
113
176
## [0.3.0] - 2024-01-17
177
+
114
178
### Added
179
+
115
180
-`toBe("mismatched")` now gets rewritten in write mode
116
181
- fully implemented the new control scheme ([#74](https://github.com/diffplug/selfie/issues/74))
117
182
- integers get `_` separators for thousands, millions, etc
183
+
118
184
### Known broken
185
+
119
186
- Groovy multiline strings
120
187
- Binary
121
188
122
189
## [0.2.0] - 2023-12-27
190
+
123
191
### Added
192
+
124
193
-`DiskSelfie.toMatchDisk` now returns `DiskSelfie` so that we can fluently chain inline assertions on facets.
125
194
126
195
## [0.1.3] - 2023-12-26
127
-
- Publish `selfie-lib-jvm` *and* `selfie-lib` to Maven Central.
196
+
197
+
- Publish `selfie-lib-jvm`_and_`selfie-lib` to Maven Central.
128
198
129
199
## [0.1.2] - 2023-12-26
200
+
130
201
- Publish `selfie-lib-jvm` instead of just `selfie-lib` to Maven Central.
0 commit comments