From 6d6781dcefdff96b3b0b5e9850eae534726c5cd7 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Sat, 6 Apr 2024 11:58:56 +0100 Subject: [PATCH] t/unstow_orig.t: use like() for regexp matching tests This is better because it outputs the mismatching value when the matching check fails. --- t/unstow_orig.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/unstow_orig.t b/t/unstow_orig.t index 0c2a646..9d62bd9 100755 --- a/t/unstow_orig.t +++ b/t/unstow_orig.t @@ -330,8 +330,9 @@ subtest("Unstowing when target contains a real file shouldn't be an issue", sub is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg12 for third time'); %conflicts = $stow->get_conflicts; is($stow->get_conflict_count, 1); - ok($conflicts{unstow}{pkg12}[0] - =~ m!existing target is neither a link nor a directory: man12/man1/file12\.1! + like( + $conflicts{unstow}{pkg12}[0], + qr!existing target is neither a link nor a directory: man12/man1/file12\.1! => 'unstow pkg12 for third time' ); });