Skip to contentSkip to conversation

test: Account again for variations in error messages

PATCH Superseded [email protected] 2 participants 2 messages Oct 10, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: Account again for variations in error messages

From: Eugene Loh <[email protected]>

In commit 944dac095 ("test: Account for variations in error messages"), an attempt was made to account for variations in error messages.

However, it was applied to the branch after commit 49e646183 ("test: dupstruct: fix extra duplicate identifier case"), and conflict resolution was not consistent. The earlier patch "standardized" messages by applying an optional "enumerator" where that label was missing; the subsequent patch did the opposite. Subsequently, some logic got messed up.

Fix up the logic. In particular, standardize on the shorter error message (without the "enumerator" label) and adjust one .r file accordingly.

---
 test/unittest/types/err.D_UNKNOWN.dupstruct.r | 2 +-
 test/utils/libctf.r.p                         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
test/unittest/types/err.D_UNKNOWN.dupstruct.r +1 -1
index 762b24f4c..7afa74aa7 100644
@@ -1,2 +1,2 @@
 -- @@stderr --
-dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member, enumerator, or variable name
+dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member or variable name
test/utils/libctf.r.p +2 -2
index 8a6fd8b13..b7c8a5e04 100755
@@ -3,10 +3,10 @@
 # http://oss.oracle.com/licenses/upl.
 
 # Possible 'enumerator' label.
-/Duplicate member or variable name/ { sub(/Duplicate member/, "&, enumerator,"); }
+/Duplicate member, enumerator, or variable name/ { sub(/ber, enumerator, or var/, "ber or var"); }
 
 # Possible trailing '.'.
-/Duplicate member, enumerator, or variable name\.$/ { sub(/\.$/, ""); }
+/Duplicate member or variable name\.$/ { sub(/\.$/, ""); }
 /Member name not found\.$/ { sub(/\.$/, ""); }
 
 # Could be union or struct.
Signature · 1 line
2.47.3
#1 lore raw
Quoted 12 lines · On Thu, Oct 09, 2025 at 11:13:38PM -0400, [email protected] wrote:

From: Eugene Loh <[email protected]>

In commit 944dac095 ("test: Account for variations in error messages"), an attempt was made to account for variations in error messages.

However, it was applied to the branch after commit 49e646183 ("test: dupstruct: fix extra duplicate identifier case"), and conflict resolution was not consistent. The earlier patch "standardized" messages by applying an optional "enumerator" where that label was missing; the subsequent patch did the opposite. Subsequently, some logic got messed up.

Quoted 3 lines

Fix up the logic. In particular, standardize on the shorter error message (without the "enumerator" label) and adjust one .r file accordingly.

My bad in merging, I think.

Anyway, I think we should standardize on what the most recent (and hopefully) final form of the error message is rather than the shortest. I.e. make the current libctf error message the default, and adjust the older version to be like the current one.

Quoted 35 lines
---
 test/unittest/types/err.D_UNKNOWN.dupstruct.r | 2 +-
 test/utils/libctf.r.p                         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
test/unittest/types/err.D_UNKNOWN.dupstruct.r +1 -1
index 762b24f4c..7afa74aa7 100644
@@ -1,2 +1,2 @@
 -- @@stderr --
-dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member, enumerator, or variable name
+dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member or variable name
test/utils/libctf.r.p +2 -2
index 8a6fd8b13..b7c8a5e04 100755
@@ -3,10 +3,10 @@
 # http://oss.oracle.com/licenses/upl.
 
 # Possible 'enumerator' label.
-/Duplicate member or variable name/ { sub(/Duplicate member/, "&, enumerator,"); }
+/Duplicate member, enumerator, or variable name/ { sub(/ber, enumerator, or var/, "ber or var"); }
 
 # Possible trailing '.'.
-/Duplicate member, enumerator, or variable name\.$/ { sub(/\.$/, ""); }
+/Duplicate member or variable name\.$/ { sub(/\.$/, ""); }
 /Member name not found\.$/ { sub(/\.$/, ""); }
 
 # Could be union or struct.
Signature · 1 line
2.47.3