From 9cc7b0506444a06ce5054f7269cd07945e7dfd2a Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Sun, 3 Nov 2024 11:08:10 -0700 Subject: [PATCH 1/2] diff-remove-abspath: Remove capture of windows drive letters from POSIX regex --- testing/scripts/diff-remove-abspath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/scripts/diff-remove-abspath b/testing/scripts/diff-remove-abspath index 7c30936262..7206c5d440 100755 --- a/testing/scripts/diff-remove-abspath +++ b/testing/scripts/diff-remove-abspath @@ -4,4 +4,4 @@ sed -E 's#/+#/#g' | sed -E 's#[^( ]*testing_btest#<___>testing_btest#' | - sed -E 's#([a-zA-Z]:)?/([^ :/]{1,}/){1,}([^ :/]{1,})#<...>/\3#g' + sed -E 's#/([^ :/]{1,}/){1,}([^ :/]{1,})#<...>/\2#g' From b8b14537a9a401b969b88b48bfcefd0712239dfc Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Sun, 3 Nov 2024 16:56:12 -0700 Subject: [PATCH 2/2] diff-remove-abspath: Add separate handling of Windows paths --- testing/scripts/diff-remove-abspath | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testing/scripts/diff-remove-abspath b/testing/scripts/diff-remove-abspath index 7206c5d440..eaf90bb415 100755 --- a/testing/scripts/diff-remove-abspath +++ b/testing/scripts/diff-remove-abspath @@ -2,6 +2,9 @@ # # Replace absolute paths with the basename. +# The drive letter portion of the Windows regex below is adapted from +# https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/regexp/basename-windows/lib/regexp.js sed -E 's#/+#/#g' | sed -E 's#[^( ]*testing_btest#<___>testing_btest#' | - sed -E 's#/([^ :/]{1,}/){1,}([^ :/]{1,})#<...>/\2#g' + sed -E 's#/([^ :/]{1,}/){1,}([^ :/]{1,})#<...>/\2#g' | + sed -E 's#([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)([\\/])([^ :\\/]{1,}[\\/]){1,}([^ :\\/]{1,})#<...>/\4#g'