Ryan Liptak
90fde14c5f
std.testing.expectEqualSlices: On failure, print address for pointer types
When comparing slice elements, `std.meta.eql` is used which only compares pointer address and length to determine equality for pointer types. This previously led to confusing results where `expectEqualSlices` would appear to fail on seemingly equal slices (judging by the output of `expectEqualSlices`. For example:
try testing.expectEqualSlices(
[]const i64,
&[_][]const i64{ &[_]i64{ 1, 2, 3 }, &[_]i64{ 5, 5, 5 } },
&[_][]const i64{ &[_]i64{ 1, 2, 3 }, &[_]i64{ 5, 5, 5 } },
);
Previously, this would result in:
============ expected this output: ============= len: 2 (0x2)
[0]: { 1, 2, 3 }
[1]: { 5, 5, 5 }
============= instead found this: ============== len: 2 (0x2)
[0]: { 1, 2, 3 }
[1]: { 5, 5, 5 }
================================================
After this commit, it will result in:
============ expected this output: ============= len: 2 (0x2)
[0]i64@7ff7e2773758: { 1, 2, 3 }
[1]i64@7ff7e2773770: { 5, 5, 5 }
============= instead found this: ============== len: 2 (0x2)
[0]i64@7ff7e2773788: { 1, 2, 3 }
[1]i64@7ff7e27737a0: { 5, 5, 5 }
================================================
2023-08-05 11:54:26 -07:00
..
2023-06-24 16:56:39 -07:00
2023-08-03 09:52:15 -07:00
2023-07-31 11:57:48 -07:00
2023-06-24 16:56:39 -07:00
2023-07-24 10:56:38 -07:00
2023-07-26 20:58:29 -04:00
2023-06-24 16:56:39 -07:00
2023-07-25 11:03:11 -07:00
2023-07-27 10:22:54 -07:00
2023-07-24 13:47:45 -04:00
2023-08-02 17:39:52 -04:00
2023-07-23 13:58:34 -07:00
2023-07-24 17:32:06 -07:00
2023-07-27 10:23:58 -07:00
2023-08-02 12:00:14 -07:00
2023-07-25 10:55:04 -07:00
2023-06-24 16:56:39 -07:00
2023-08-02 18:19:07 -04:00
2023-07-24 10:23:51 -07:00
2023-06-27 00:51:06 -07:00
2023-06-19 12:34:42 -07:00
2023-06-24 16:56:39 -07:00
2023-07-26 08:19:52 -05:00
2023-06-24 16:56:39 -07:00
2023-06-24 16:56:39 -07:00
2023-06-24 16:56:39 -07:00
2023-08-03 09:52:15 -07:00
2023-07-18 19:02:05 -07:00
2023-07-16 18:32:52 -07:00
2023-06-16 13:44:09 -07:00
2023-06-24 16:56:39 -07:00
2023-06-24 16:56:39 -07:00
2023-07-21 19:56:46 -04:00
2023-07-03 13:58:03 -04:00
2023-07-30 18:42:08 -07:00
2023-07-31 03:49:21 -04:00
2023-07-31 10:51:44 -07:00
2023-07-27 09:35:29 -07:00
2023-07-27 10:21:12 -07:00
2023-06-26 17:50:10 -07:00
2023-06-25 14:51:03 -07:00
2023-08-04 09:24:11 +02:00
2023-07-26 20:58:29 -04:00
2023-06-24 16:56:39 -07:00
2023-07-20 22:58:12 -04:00
2023-06-26 17:50:10 -07:00
2023-06-16 13:44:09 -07:00
2023-06-24 16:56:39 -07:00
2023-08-02 17:39:52 -04:00
2023-07-24 10:23:51 -07:00
2023-08-02 17:39:52 -04:00
2023-07-23 13:58:34 -07:00
2023-06-24 16:56:39 -07:00
2023-07-21 19:56:46 -04:00
2023-07-24 10:23:51 -07:00
2023-07-15 21:37:54 -07:00
2023-06-19 12:34:42 -07:00
2023-07-20 22:58:16 -04:00
2023-08-02 12:00:14 -07:00
2023-07-12 15:35:57 -07:00
2023-07-25 16:19:08 -07:00
2023-07-11 06:37:51 +00:00
2023-06-30 23:24:52 -04:00
2023-07-31 11:23:38 -07:00
2023-06-24 16:56:39 -07:00
2023-06-30 23:23:03 -04:00
2023-06-22 02:03:53 -07:00
2023-07-24 12:58:19 -07:00
2023-08-01 19:27:04 -07:00
2023-07-25 13:51:22 +01:00
2023-06-24 16:56:39 -07:00
2023-06-19 12:34:42 -07:00
2023-06-24 16:56:39 -07:00
2023-06-17 13:17:34 -07:00
2023-07-12 15:35:57 -07:00
2023-06-27 00:51:06 -07:00
2023-06-24 16:56:39 -07:00
2023-08-02 18:19:07 -04:00
2023-07-21 19:56:46 -04:00
2023-06-24 16:56:39 -07:00
2023-08-03 09:37:10 -07:00
2023-08-05 11:54:26 -07:00
2023-07-31 15:34:32 -07:00
2023-07-07 11:57:09 -07:00
2023-06-19 12:34:42 -07:00
2023-06-24 16:56:39 -07:00
2023-06-24 16:56:39 -07:00
2023-07-27 13:18:48 -04:00
2023-06-24 16:56:39 -07:00
2023-06-19 12:34:42 -07:00
2023-06-24 16:56:39 -07:00