aboutsummaryrefslogtreecommitdiff
path: root/lib/std/testing.zig
diff options
context:
space:
mode:
authorStephen Lumenta <stephen.lumenta@gmail.com>2021-10-29 00:00:50 +0200
committerAndrew Kelley <andrew@ziglang.org>2021-12-21 17:33:04 -0800
commitefab3b1e6dfe2fb1115de2202d3b034b82142815 (patch)
tree51b7cc9e33cebfdeed36e3d758b0fd23382ce784 /lib/std/testing.zig
parent24cca2a55e9fce5bd13bbda731cfa632885bcd3f (diff)
downloadzig-efab3b1e6dfe2fb1115de2202d3b034b82142815.tar.gz
zig-efab3b1e6dfe2fb1115de2202d3b034b82142815.zip
fix expectStringEndsWith error output.
before it started outputting the actual starting, not ending characters.
Diffstat (limited to 'lib/std/testing.zig')
-rw-r--r--lib/std/testing.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig
index e5c2afab40..c6a498cfff 100644
--- a/lib/std/testing.zig
+++ b/lib/std/testing.zig
@@ -406,7 +406,7 @@ pub fn expectStringEndsWith(actual: []const u8, expected_ends_with: []const u8)
return;
const shortened_actual = if (actual.len >= expected_ends_with.len)
- actual[0..expected_ends_with.len]
+ actual[(actual.len - expected_ends_with.len)..]
else
actual;