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