From 1c8173487104f905482b1d5a327defadf2c64573 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 22 Feb 2025 18:11:15 -0700 Subject: test(unit/strings_spec): show ctx when vim_snprintf content check fails #32570 Same idea as a7be4b7bf857, but that only showed the context if the length of the string differed. Since these tests check both string length and string content, the ctx should be provided for both. ERROR test/unit/testutil.lua @ 797: vim_snprintf() positional arguments test/unit/testutil.lua:769: test/unit/testutil.lua:753: (string) ' test/unit/strings_spec.lua:159: snprintf(buf, 4, "%1$0.*2$b", 12ULL, cdata: 0xf78c8ed8) = 001100 Expected objects to be the same. Passed in: (string) '000' Expected: (string) '001'' --- test/unit/strings_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/unit/strings_spec.lua b/test/unit/strings_spec.lua index 2b7a4d6261..8df9837c90 100644 --- a/test/unit/strings_spec.lua +++ b/test/unit/strings_spec.lua @@ -156,7 +156,7 @@ describe('vim_snprintf()', function() eq(#expected, strings.vim_snprintf(buf, bsize, fmt, ...), ctx) if bsize > 0 then local actual = ffi.string(buf, math.min(#expected + 1, bsize)) - eq(expected:sub(1, bsize - 1) .. '\0', actual) + eq(expected:sub(1, bsize - 1) .. '\0', actual, ctx) end end -- cgit