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
Copy file name to clipboardexpand all lines: README.md
+6-4
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Let me show you its features!
15
15
The best way to use `ohsnap` is to install it using the [Zig Build System](https://ziglang.org/learn/build-system/). From your project repo root, use `zig fetch` like this:
But of course, the next time we run the test, the timestamp will be different, so the test will fail. We care about the message and the tag, we care that there _is_ a timestamp, but we don't care what the timestamp is, because we know it will be changing.
144
144
145
-
For this purpose, `ohsnap` includes [mvzr](https://github.com/mnemnion/mvzr), the Minimum Viable Zig Regex library, which I wrote specifically for this purpose.
145
+
For cases like this, `ohsnap` includes [mvzr](https://github.com/mnemnion/mvzr), the Minimum Viable Zig Regex library, which I wrote specifically for this purpose.
146
146
147
147
Simply replace the timestamp like so:
148
148
@@ -171,7 +171,7 @@ Let's say you make a change:
171
171
);
172
172
```
173
173
174
-
The test will now fail: the word "thoroughly" will be highlighted in green, `turbo-` will be marked in red, and the timestamp will be cyan, indicating that the regex is still matching the pattern string. If a change in the test means that the regex no longer matches, then the part of the test string which should match is highlighted in magenta.
174
+
The test will now fail: the word "thoroughly" will be highlighted in green, `turbo-` will be marked in red, and the timestamp will be cyan, indicating that the regex is still matching the pattern string. If a change in the test data means that the regex no longer matches, then the part of the test string which should match is highlighted in magenta.
175
175
176
176
Since this was an intentional change, we need to update the snap:
177
177
@@ -210,7 +210,9 @@ Usage note: in some cases, the changes to the new string will displace the regex
210
210
211
211
One of the great advantages of snapshot testing is that it's easy, so `ohsnap`, like the library it's based upon, is intentionally quite simple. Simple, yet versatile, the latter to a large degree is owed to `pretty`, which can handle anything I've thrown at it, types, unions, you name it.
212
212
213
-
It's a new library, but no changes to the interface are likely. It's meant to do one thing, well, and otherwise stay out of the way. That said, the regex library `mvzr` is pretty new, and so is the added code in `diffz`, so version-bumps to fix any bugs in those can be expected over time.
213
+
It's a new library, but I expect the core interface to remain stable. It's meant to do one thing, well, and otherwise stay out of the way. I'm willing to consider suggestions for ways to make `ohsnap` better at what it already does, however.
214
+
215
+
That said, the regex library `mvzr` is pretty new, and so is the added code in `diffz`, so version-bumps to fix any bugs in those can be expected over time. The build system doesn't currently do update checks, so you'll need to check for updates manually, for now.
214
216
215
217
I hope you enjoy it! Test early, test often, and do it the easy way.
0 commit comments