Skip to content

Commit

Permalink
Pretty (and ohsnap) version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
mnemnion committed Aug 23, 2024
1 parent 930f43e commit 0cd85a8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Let me show you its features!
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:

```sh
zig fetch --save "https://github.com/mnemnion/ohsnap/archive/refs/tags/v0.3.0.tar.gz"
zig fetch --save "https://github.com/mnemnion/ohsnap/archive/refs/tags/v0.3.1.tar.gz"
```

Then add it to your test artifact like so:
Expand Down Expand Up @@ -126,14 +126,14 @@ test "snap with timestamp" {
const oh = OhSnap{};
const with_stamp = StampedStruct.init(
"frobnicate the turbo-encabulator",
37337,
31337,
);
try oh.snap(
@src(),
\\ohsnap.StampedStruct
\\ .message: []const u8
\\ "frobnicate the turbo-encabulator"
\\ .tag: u64 = 37337
\\ .tag: u64 = 31337
\\ .timestamp: isize = 1721501316
,
).expectEqual(with_stamp);
Expand All @@ -152,7 +152,7 @@ Simply replace the timestamp like so:
\\ohsnap.StampedStruct
\\ .message: []const u8
\\ "frobnicate the turbo-encabulator"
\\ .tag: u64 = 37337
\\ .tag: u64 = 31337
\\ .timestamp: isize = <^\d+$>
,
).expectEqual(with_stamp);
Expand All @@ -167,7 +167,7 @@ Let's say you make a change:
```zig
const with_stamp = StampedStruct.init(
"thoroughly frobnicate the encabulator",
37337,
31337,
);
```

Expand All @@ -182,7 +182,7 @@ Since this was an intentional change, we need to update the snap:
\\ohsnap.StampedStruct
\\ .message: []const u8
\\ "frobnicate the turbo-encabulator"
\\ .tag: u64 = 37337
\\ .tag: u64 = 31337
\\ .timestamp: isize = <^\d+$>
,
).expectEqual(with_stamp);
Expand All @@ -196,7 +196,7 @@ Once again, through the magic of diffing, `ohsnap` will locate the regexen in th
\\ohsnap.StampedStruct
\\ .message: []const u8
\\ "thoroughly frobnicate the encabulator"
\\ .tag: u64 = 37337
\\ .tag: u64 = 31337
\\ .timestamp: isize = <^\d+$>
,
).expectEqual(with_stamp);
Expand Down
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub fn build(b: *std.Build) void {
lib_unit_tests.root_module.addImport("diffz", diffz_dep.module("diffz"));
snap_module.addImport("diffz", diffz_dep.module("diffz"));
}

if (b.lazyDependency("mvzr", .{
.target = target,
.optimize = optimize,
Expand Down
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// This is a [Semantic Version](https://semver.org/).
// In a future version of Zig it will be used for package deduplication.
.version = "0.2.2",
.version = "0.3.1",

// This field is optional.
// This is currently advisory only; Zig does not yet do anything
Expand All @@ -25,8 +25,8 @@

.dependencies = .{
.pretty = .{
.url = "https://github.com/timfayz/pretty/archive/refs/tags/v0.10.2.tar.gz",
.hash = "12201325c0651a8cc167d1d3bd07a71aa3b87b91065d45a64298a3e1d5716d62ed85",
.url = "https://github.com/timfayz/pretty/archive/refs/tags/v0.10.4.tar.gz",
.hash = "1220db3fa6510f1686587aab46ac92a882d4f5a287a20d7b687f654a7b8ce3a0e8d6",
},
.diffz = .{
.url = "https://github.com/mnemnion/diffz/archive/refs/tags/v0.0.4-rc1.tar.gz",
Expand Down

0 comments on commit 0cd85a8

Please sign in to comment.